Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet If we are sending a window probe and there's una...



details:   https://anonhg.NetBSD.org/src/rev/a2c4b9990d77
branches:  trunk
changeset: 339470:a2c4b9990d77
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Jul 24 04:33:50 2015 +0000

description:
If we are sending a window probe and there's unacked data in the socket, make
sure at least the persist timer is running.

diffstat:

 sys/netinet/tcp_output.c |  26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diffs (49 lines):

diff -r 50e70aa49e12 -r a2c4b9990d77 sys/netinet/tcp_output.c
--- a/sys/netinet/tcp_output.c  Fri Jul 24 04:31:20 2015 +0000
+++ b/sys/netinet/tcp_output.c  Fri Jul 24 04:33:50 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_output.c,v 1.183 2015/05/16 01:15:34 kefren Exp $  */
+/*     $NetBSD: tcp_output.c,v 1.184 2015/07/24 04:33:50 matt 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.183 2015/05/16 01:15:34 kefren Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.184 2015/07/24 04:33:50 matt Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -1533,14 +1533,24 @@
                 * 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))



Home | Main Index | Thread Index | Old Index