HomeFreeBSD

MFC 301932: Use sbused() instead of sbspace() to avoid signed issues.

Description

MFC 301932: Use sbused() instead of sbspace() to avoid signed issues.

Inserting a full mbuf with an external cluster into the socket buffer
resulted in sbspace() returning -MLEN. However, since sb_hiwat is
unsigned, the -MLEN value was converted to unsigned in comparisons. As a
result, the socket buffer was never autosized. Note that sb_lowat is signed
to permit direct comparisons with sbspace(), but sb_hiwat is unsigned.
Follow suit with what tcp_output() does and compare the value of sbused()
with sb_hiwat instead.

Note: Since stable/10 does not include sbused(), this uses sb->sb_cc
instead.

Sponsored by: Chelsio Communications

Details

Provenance
jhbAuthored on
Parents
rS308282: MFC 290175,290633,299206,300895,301898: Various TOE fixes.
Branches
Unknown
Tags
Unknown