diff options
author | Andre Oppermann <andre@FreeBSD.org> | 2007-03-15 15:59:28 +0000 |
---|---|---|
committer | Andre Oppermann <andre@FreeBSD.org> | 2007-03-15 15:59:28 +0000 |
commit | 02a1a64357ad61f9660e5c75b1e1492303085a14 (patch) | |
tree | 958c5cc9f9700b70c7ad5f201a98774762724e25 /sys/netinet/tcp_input.c | |
parent | 7a5897d4d933f9520350c6f723eeff1c106ee9a6 (diff) | |
download | src-02a1a64357ad61f9660e5c75b1e1492303085a14.tar.gz src-02a1a64357ad61f9660e5c75b1e1492303085a14.zip |
Consolidate insertion of TCP options into a segment from within tcp_output()
and syncache_respond() into its own generic function tcp_addoptions().
tcp_addoptions() is alignment agnostic and does optimal packing in all cases.
In struct tcpopt rename to_requested_s_scale to just to_wscale.
Add a comment with quote from RFC1323: "The Window field in a SYN (i.e.,
a <SYN> or <SYN,ACK>) segment itself is never scaled."
Reviewed by: silby, mohans, julian
Sponsored by: TCP/IP Optimization Fundraise 2005
Notes
Notes:
svn path=/head/; revision=167606
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 2d88d47acffb..eb513492bc74 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1146,7 +1146,7 @@ after_listen: if ((to.to_flags & TOF_SCALE) && (tp->t_flags & TF_REQ_SCALE)) { tp->t_flags |= TF_RCVD_SCALE; - tp->snd_scale = to.to_requested_s_scale; + tp->snd_scale = to.to_wscale; tp->snd_wnd = th->th_win << tp->snd_scale; tiwin = tp->snd_wnd; } @@ -2745,7 +2745,7 @@ tcp_dooptions(to, cp, cnt, flags) if (!(flags & TO_SYN)) continue; to->to_flags |= TOF_SCALE; - to->to_requested_s_scale = min(cp[2], TCP_MAX_WINSHIFT); + to->to_wscale = min(cp[2], TCP_MAX_WINSHIFT); break; case TCPOPT_TIMESTAMP: if (optlen != TCPOLEN_TIMESTAMP) |