VirtualBox

Ignore:
Timestamp:
Jun 4, 2010 8:38:56 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
62400
Message:

NAT: BSD sbuf.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/tcp_output.c

    r30016 r30045  
    155155             * itself.
    156156             */
    157             if (off < so->so_snd.sb_cc)
     157            if (off < SBUF_LEN(&so->so_snd))
    158158                flags &= ~TH_FIN;
    159159            win = 1;
     
    166166    }
    167167
    168     len = min(so->so_snd.sb_cc, win) - off;
     168    len = min(SBUF_LEN(&so->so_snd), win) - off;
    169169    if (len < 0)
    170170    {
     
    191191        sendalot = 1;
    192192    }
    193     if (SEQ_LT(tp->snd_nxt + len, tp->snd_una + so->so_snd.sb_cc))
     193    if (SEQ_LT(tp->snd_nxt + len, tp->snd_una + SBUF_LEN(&so->so_snd)))
    194194        flags &= ~TH_FIN;
    195195
     
    211211            goto send;
    212212        if ((1 || idle || tp->t_flags & TF_NODELAY) &&
    213                 len + off >= so->so_snd.sb_cc)
     213                len + off >= SBUF_LEN(&so->so_snd))
    214214            goto send;
    215215        if (tp->t_force)
     
    241241        if (adv >= (long) (2 * tp->t_maxseg))
    242242            goto send;
    243         if (2 * adv >= (long) so->so_rcv.sb_datalen)
     243        if (2 * adv >= (long) SBUF_SIZE(&so->so_rcv))
    244244            goto send;
    245245    }
     
    285285     * otherwise force out a byte.
    286286     */
    287     if (   so->so_snd.sb_cc
     287    if (   SBUF_LEN(&so->so_snd)
    288288        && tp->t_timer[TCPT_REXMT] == 0
    289289        && tp->t_timer[TCPT_PERSIST] == 0)
     
    421421        {
    422422#endif
     423#ifndef VBOX_WITH_SLIRP_BSD_SBUF
    423424            sbcopy(&so->so_snd, off, (int) len, mtod(m, caddr_t) + hdrlen);
    424425            m->m_len += len;
     426#else
     427            m_copyback(pData, m, hdrlen, len, sbuf_data(&so->so_snd) + off);
     428#endif
    425429#if 0
    426430        }
     
    438442         * a PUSH comes in.)
    439443         */
    440         if (off + len == so->so_snd.sb_cc)
     444        if (off + len == SBUF_LEN(&so->so_snd))
    441445            flags |= TH_PUSH;
    442446    }
     
    525529     * but avoid silly window syndrome.
    526530     */
    527     if (win < (long)(so->so_rcv.sb_datalen / 4) && win < (long)tp->t_maxseg)
     531    if (win < (long)(SBUF_SIZE(&so->so_rcv) / 4) && win < (long)tp->t_maxseg)
    528532        win = 0;
    529533    if (win > (long)TCP_MAXWIN << tp->rcv_scale)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette