tcp_output: Always clear TF_ACKNOW before returning
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 15 Jun 2012 09:17:48 +0000 (17:17 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 15 Jun 2012 09:17:48 +0000 (17:17 +0800)
sys/netinet/tcp_output.c

index 58296c5..492e33e 100644 (file)
@@ -305,8 +305,10 @@ again:
        if ((flags & TH_SYN) && SEQ_GT(tp->snd_nxt, tp->snd_una)) {
                flags &= ~TH_SYN;
                off--, len++;
-               if (len > 0 && tp->t_state == TCPS_SYN_SENT)
+               if (len > 0 && tp->t_state == TCPS_SYN_SENT) {
+                       tp->t_flags &= ~TF_ACKNOW;
                        return 0;
+               }
        }
 
        /*
@@ -1063,6 +1065,7 @@ after_th:
                KASSERT(error != 0, ("no error, but th not set"));
        }
        if (error) {
+               tp->t_flags &= ~TF_ACKNOW;
 
                /*
                 * We know that the packet was lost, so back out the