Module Name: src Committed By: martin Date: Fri Jul 24 07:47:03 UTC 2015
Modified Files: src/sys/netinet [netbsd-5-1]: tcp_input.c tcp_output.c Log Message: Pull up following revision(s) (requested by matt in ticket #1973): sys/netinet/tcp_output.c: revision 1.184 sys/netinet/tcp_input.c: revision 1.343 If we are sending a window probe and there's unacked data in the socket, make sure at least the persist timer is running. Make sure that snd_win doesn't go negative. To generate a diff of this commit: cvs rdiff -u -r1.291.4.5 -r1.291.4.5.2.1 src/sys/netinet/tcp_input.c cvs rdiff -u -r1.167.20.1 -r1.167.20.2 src/sys/netinet/tcp_output.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/netinet/tcp_input.c diff -u src/sys/netinet/tcp_input.c:1.291.4.5 src/sys/netinet/tcp_input.c:1.291.4.5.2.1 --- src/sys/netinet/tcp_input.c:1.291.4.5 Fri Jun 11 23:36:07 2010 +++ src/sys/netinet/tcp_input.c Fri Jul 24 07:47:02 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_input.c,v 1.291.4.5 2010/06/11 23:36:07 riz Exp $ */ +/* $NetBSD: tcp_input.c,v 1.291.4.5.2.1 2015/07/24 07:47:02 martin Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -145,7 +145,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.291.4.5 2010/06/11 23:36:07 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.291.4.5.2.1 2015/07/24 07:47:02 martin Exp $"); #include "opt_inet.h" #include "opt_ipsec.h" @@ -2438,7 +2438,10 @@ after_listen: tp->t_lastm = NULL; sbdrop(&so->so_snd, acked); tp->t_lastoff -= acked; - tp->snd_wnd -= acked; + if (tp->snd_wnd > acked) + tp->snd_wnd -= acked; + else + tp->snd_wnd = 0; ourfinisacked = 0; } sowwakeup(so); Index: src/sys/netinet/tcp_output.c diff -u src/sys/netinet/tcp_output.c:1.167.20.1 src/sys/netinet/tcp_output.c:1.167.20.2 --- src/sys/netinet/tcp_output.c:1.167.20.1 Tue Mar 29 20:13:03 2011 +++ src/sys/netinet/tcp_output.c Fri Jul 24 07:47:02 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_output.c,v 1.167.20.1 2011/03/29 20:13:03 riz Exp $ */ +/* $NetBSD: tcp_output.c,v 1.167.20.2 2015/07/24 07:47:02 martin Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -135,7 +135,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.167.20.1 2011/03/29 20:13:03 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.167.20.2 2015/07/24 07:47:02 martin Exp $"); #include "opt_inet.h" #include "opt_ipsec.h" @@ -1524,14 +1524,24 @@ send: * of retransmit time. */ timer: - if (TCP_TIMER_ISARMED(tp, TCPT_REXMT) == 0 && - ((sack_rxmit && tp->snd_nxt != tp->snd_max) || - tp->snd_nxt != tp->snd_una)) { - if (TCP_TIMER_ISARMED(tp, TCPT_PERSIST)) { - TCP_TIMER_DISARM(tp, TCPT_PERSIST); + if (TCP_TIMER_ISARMED(tp, TCPT_REXMT) == 0) { + if ((sack_rxmit && tp->snd_nxt != tp->snd_max) + || tp->snd_nxt != tp->snd_una) { + if (TCP_TIMER_ISARMED(tp, TCPT_PERSIST)) { + TCP_TIMER_DISARM(tp, TCPT_PERSIST); + tp->t_rxtshift = 0; + } + TCP_TIMER_ARM(tp, TCPT_REXMT, tp->t_rxtcur); + } else if (len == 0 && so->so_snd.sb_cc > 0 + && TCP_TIMER_ISARMED(tp, TCPT_PERSIST) == 0) { + /* + * If we are sending a window probe and there's + * unacked data in the socket, make sure at + * least the persist timer is running. + */ tp->t_rxtshift = 0; + tcp_setpersist(tp); } - TCP_TIMER_ARM(tp, TCPT_REXMT, tp->t_rxtcur); } } else if (SEQ_GT(tp->snd_nxt + len, tp->snd_max))