diff options
author | hiren <hiren@FreeBSD.org> | 2015-06-29 21:23:54 +0000 |
---|---|---|
committer | hiren <hiren@FreeBSD.org> | 2015-06-29 21:23:54 +0000 |
commit | 160de052b25faecd144db05f943feddd8bd2b3a5 (patch) | |
tree | eed63ee34378414a4cb1f37873c7ff8c5dbcac1b /sys | |
parent | 9c062ec0b44a5e9c50a380b4d2d2e7efa9c07000 (diff) | |
download | FreeBSD-src-160de052b25faecd144db05f943feddd8bd2b3a5.zip FreeBSD-src-160de052b25faecd144db05f943feddd8bd2b3a5.tar.gz |
Avoid a situation where we do not set persist timer after a zero window
condition.
If you send a 0-length packet, but there is data is the socket buffer, and
neither the rexmt or persist timer is already set, then activate the persist
timer.
PR: 192599
Differential Revision: D2946
Submitted by: jlott at averesystems dot com
Reviewed by: jhb, jch, gnn, hiren
Tested by: jlott at averesystems dot com, jch
MFC after: 2 weeks
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/tcp_output.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index eb4cb47..111f22e 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1394,6 +1394,30 @@ timer: tp->t_rxtshift = 0; } tcp_timer_activate(tp, TT_REXMT, tp->t_rxtcur); + } else if (len == 0 && sbavail(&so->so_snd) && + !tcp_timer_active(tp, TT_REXMT) && + !tcp_timer_active(tp, TT_PERSIST)) { + /* + * Avoid a situation where we do not set persist timer + * after a zero window condition. For example: + * 1) A -> B: packet with enough data to fill the window + * 2) B -> A: ACK for #1 + new data (0 window + * advertisement) + * 3) A -> B: ACK for #2, 0 len packet + * + * In this case, A will not activate the persist timer, + * because it chose to send a packet. Unless tcp_output + * is called for some other reason (delayed ack timer, + * another input packet from B, socket syscall), A will + * not send zero window probes. + * + * So, if you send a 0-length packet, but there is data + * in the socket buffer, and neither the rexmt or + * persist timer is already set, then activate the + * persist timer. + */ + tp->t_rxtshift = 0; + tcp_setpersist(tp); } } else { /* |