Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102878514
D17949.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D17949.diff
View Options
Index: head/sys/netinet/tcp_output.c
===================================================================
--- head/sys/netinet/tcp_output.c
+++ head/sys/netinet/tcp_output.c
@@ -1172,14 +1172,18 @@
/*
* Calculate receive window. Don't shrink window,
* but avoid silly window syndrome.
+ * If a RST segment is sent, advertise a window of zero.
*/
- if (recwin < (so->so_rcv.sb_hiwat / 4) &&
- recwin < tp->t_maxseg)
+ if (flags & TH_RST) {
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);
-
+ } else {
+ 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);
+ }
/*
* According to RFC1323 the window field in a SYN (i.e., a <SYN>
* or <SYN,ACK>) segment itself is never scaled. The <SYN,ACK>
Index: head/sys/netinet/tcp_stacks/rack.c
===================================================================
--- head/sys/netinet/tcp_stacks/rack.c
+++ head/sys/netinet/tcp_stacks/rack.c
@@ -8189,15 +8189,20 @@
/*
* Calculate receive window. Don't shrink window, but avoid silly
* window syndrome.
+ * If a RST segment is sent, advertise a window of zero.
*/
- if (recwin < (long)(so->so_rcv.sb_hiwat / 4) &&
- recwin < (long)tp->t_maxseg)
+ if (flags & TH_RST) {
recwin = 0;
- if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) &&
- recwin < (long)(tp->rcv_adv - tp->rcv_nxt))
- recwin = (long)(tp->rcv_adv - tp->rcv_nxt);
- if (recwin > (long)TCP_MAXWIN << tp->rcv_scale)
- recwin = (long)TCP_MAXWIN << tp->rcv_scale;
+ } else {
+ if (recwin < (long)(so->so_rcv.sb_hiwat / 4) &&
+ recwin < (long)tp->t_maxseg)
+ recwin = 0;
+ if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) &&
+ recwin < (long)(tp->rcv_adv - tp->rcv_nxt))
+ recwin = (long)(tp->rcv_adv - tp->rcv_nxt);
+ if (recwin > (long)TCP_MAXWIN << tp->rcv_scale)
+ recwin = (long)TCP_MAXWIN << tp->rcv_scale;
+ }
/*
* According to RFC1323 the window field in a SYN (i.e., a <SYN> or
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 19, 8:40 AM (22 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14713471
Default Alt Text
D17949.diff (2 KB)
Attached To
Mode
D17949: Advertise a zero window when sending TCP RST segments via tcp_output()
Attached
Detach File
Event Timeline
Log In to Comment