tcp: fix premature termination of FIN_WAIT2 time-wait sockets
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / ipv4 / inet_timewait_sock.c
index 61283f9288250cc6b74d440abf7621947ed91313..13f0781f35cda6668a09d35245e3e2777de83697 100644 (file)
@@ -218,8 +218,8 @@ void inet_twdr_hangman(unsigned long data)
                /* We purged the entire slot, anything left?  */
                if (twdr->tw_count)
                        need_timer = 1;
+               twdr->slot = ((twdr->slot + 1) & (INET_TWDR_TWKILL_SLOTS - 1));
        }
-       twdr->slot = ((twdr->slot + 1) & (INET_TWDR_TWKILL_SLOTS - 1));
        if (need_timer)
                mod_timer(&twdr->tw_timer, jiffies + twdr->period);
 out: