pktgen: Fix delay handling
[safe/jmp/linux-2.6] / net / ipv4 / inet_timewait_sock.c
index 68a8d89..13f0781 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/kmemcheck.h>
 #include <net/inet_hashtables.h>
 #include <net/inet_timewait_sock.h>
 #include <net/ip.h>
@@ -120,6 +121,8 @@ struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, const int stat
        if (tw != NULL) {
                const struct inet_sock *inet = inet_sk(sk);
 
+               kmemcheck_annotate_bitfield(tw, flags);
+
                /* Give us an identity. */
                tw->tw_daddr        = inet->daddr;
                tw->tw_rcv_saddr    = inet->rcv_saddr;
@@ -215,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: