Merge branch 'mlxsw-Implement-periodic-ERP-rehash'
[linux-2.6-microblaze.git] / include / net / ipv6_frag.h
index 6ced1e6..28aa9b3 100644 (file)
@@ -82,8 +82,15 @@ ip6frag_expire_frag_queue(struct net *net, struct frag_queue *fq)
        __IP6_INC_STATS(net, __in6_dev_get(dev), IPSTATS_MIB_REASMTIMEOUT);
 
        /* Don't send error if the first segment did not arrive. */
-       head = fq->q.fragments;
-       if (!(fq->q.flags & INET_FRAG_FIRST_IN) || !head)
+       if (!(fq->q.flags & INET_FRAG_FIRST_IN))
+               goto out;
+
+       /* sk_buff::dev and sk_buff::rbnode are unionized. So we
+        * pull the head out of the tree in order to be able to
+        * deal with head->dev.
+        */
+       head = inet_frag_pull_head(&fq->q);
+       if (!head)
                goto out;
 
        head->dev = dev;