Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160950902
D16503.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D16503.id.diff
View Options
Index: head/sys/netinet/tcp_timewait.c
===================================================================
--- head/sys/netinet/tcp_timewait.c
+++ head/sys/netinet/tcp_timewait.c
@@ -230,6 +230,7 @@
struct tcptw twlocal, *tw;
struct inpcb *inp = tp->t_inpcb;
struct socket *so;
+ uint32_t recwin;
bool acknow, local;
#ifdef INET6
bool isipv6 = inp->inp_inc.inc_flags & INC_ISIPV6;
@@ -292,10 +293,16 @@
/*
* Recover last window size sent.
*/
- if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt))
- tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale;
- else
- tw->last_win = 0;
+ so = inp->inp_socket;
+ recwin = lmin(lmax(sbspace(&so->so_rcv), 0),
+ (long)TCP_MAXWIN << tp->rcv_scale);
+ if (recwin < (so->so_rcv.sb_hiwat / 4) &&
+ recwin < tp->t_maxseg)
+ recwin = 0;
+ if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) &&
+ recwin < (tp->rcv_adv - tp->rcv_nxt))
+ recwin = (tp->rcv_adv - tp->rcv_nxt);
+ tw->last_win = htons((u_short)(recwin >> tp->rcv_scale));
/*
* Set t_recent if timestamps are used on the connection.
@@ -332,7 +339,6 @@
* and might not be needed here any longer.
*/
tcp_discardcb(tp);
- so = inp->inp_socket;
soisdisconnected(so);
tw->tw_so_options = so->so_options;
inp->inp_flags |= INP_TIMEWAIT;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jun 30, 9:03 AM (14 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34476518
Default Alt Text
D16503.id.diff (1 KB)
Attached To
Mode
D16503: Send consistent SEG.WIN when sending from the timewait code path
Attached
Detach File
Event Timeline
Log In to Comment