Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140783116
D5625.id14290.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
D5625.id14290.diff
View Options
Index: sys/netinet/tcp_input.c
===================================================================
--- sys/netinet/tcp_input.c
+++ sys/netinet/tcp_input.c
@@ -2731,6 +2731,9 @@
INP_WLOCK_ASSERT(tp->t_inpcb);
acked = BYTES_THIS_ACK(tp, th);
+ KASSERT(acked >= 0, ("%s: acked unexepectedly negative "
+ "(tp->snd_una=%u, th->th_ack=%u, tp=%p, m=%p)", tp->snd_una,
+ th->th_ack, tp, m));
TCPSTAT_INC(tcps_rcvackpack);
TCPSTAT_ADD(tcps_rcvackbyte, acked);
@@ -2800,13 +2803,19 @@
SOCKBUF_LOCK(&so->so_snd);
if (acked > sbavail(&so->so_snd)) {
- tp->snd_wnd -= sbavail(&so->so_snd);
+ if (tp->snd_wnd >= sbavail(&so->so_snd))
+ tp->snd_wnd -= sbavail(&so->so_snd);
+ else
+ tp->snd_wnd = 0;
mfree = sbcut_locked(&so->so_snd,
(int)sbavail(&so->so_snd));
ourfinisacked = 1;
} else {
mfree = sbcut_locked(&so->so_snd, acked);
- tp->snd_wnd -= acked;
+ if (tp->snd_wnd >= (u_long) acked)
+ tp->snd_wnd -= acked;
+ else
+ tp->snd_wnd = 0;
ourfinisacked = 0;
}
/* NB: sowwakeup_locked() does an implicit unlock. */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 29, 12:05 AM (4 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27346558
Default Alt Text
D5625.id14290.diff (1 KB)
Attached To
Mode
D5625: Prevent underflows in tp->snd_wnd
Attached
Detach File
Event Timeline
Log In to Comment