]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/ipv6/netfilter/nf_conntrack_reasm.c
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[karo-tx-linux.git] / net / ipv6 / netfilter / nf_conntrack_reasm.c
index 3d4bccf6d67d38cd84b04cda51fd9234b20f3d2e..6f187c8d8a1bdf4ab27ec71ea05e865fcf782371 100644 (file)
@@ -50,6 +50,7 @@
 #include <linux/module.h>
 #include <net/netfilter/ipv6/nf_defrag_ipv6.h>
 
+static const char nf_frags_cache_name[] = "nf-frags";
 
 struct nf_ct_frag6_skb_cb
 {
@@ -222,7 +223,7 @@ static int nf_ct_frag6_queue(struct frag_queue *fq, struct sk_buff *skb,
        int offset, end;
        u8 ecn;
 
-       if (fq->q.last_in & INET_FRAG_COMPLETE) {
+       if (fq->q.flags & INET_FRAG_COMPLETE) {
                pr_debug("Already completed\n");
                goto err;
        }
@@ -253,11 +254,11 @@ static int nf_ct_frag6_queue(struct frag_queue *fq, struct sk_buff *skb,
                 * or have different end, the segment is corrupted.
                 */
                if (end < fq->q.len ||
-                   ((fq->q.last_in & INET_FRAG_LAST_IN) && end != fq->q.len)) {
+                   ((fq->q.flags & INET_FRAG_LAST_IN) && end != fq->q.len)) {
                        pr_debug("already received last fragment\n");
                        goto err;
                }
-               fq->q.last_in |= INET_FRAG_LAST_IN;
+               fq->q.flags |= INET_FRAG_LAST_IN;
                fq->q.len = end;
        } else {
                /* Check if the fragment is rounded to 8 bytes.
@@ -272,7 +273,7 @@ static int nf_ct_frag6_queue(struct frag_queue *fq, struct sk_buff *skb,
                }
                if (end > fq->q.len) {
                        /* Some bits beyond end -> corruption. */
-                       if (fq->q.last_in & INET_FRAG_LAST_IN) {
+                       if (fq->q.flags & INET_FRAG_LAST_IN) {
                                pr_debug("last packet already reached.\n");
                                goto err;
                        }
@@ -354,7 +355,7 @@ found:
         */
        if (offset == 0) {
                fq->nhoffset = nhoff;
-               fq->q.last_in |= INET_FRAG_FIRST_IN;
+               fq->q.flags |= INET_FRAG_FIRST_IN;
        }
 
        return 0;
@@ -617,7 +618,7 @@ struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user)
                goto ret_orig;
        }
 
-       if (fq->q.last_in == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) &&
+       if (fq->q.flags == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) &&
            fq->q.meat == fq->q.len) {
                ret_skb = nf_ct_frag6_reasm(fq, dev);
                if (ret_skb == NULL)
@@ -677,12 +678,15 @@ int nf_ct_frag6_init(void)
        nf_frags.qsize = sizeof(struct frag_queue);
        nf_frags.match = ip6_frag_match;
        nf_frags.frag_expire = nf_ct_frag6_expire;
-       inet_frags_init(&nf_frags);
-
+       nf_frags.frags_cache_name = nf_frags_cache_name;
+       ret = inet_frags_init(&nf_frags);
+       if (ret)
+               goto out;
        ret = register_pernet_subsys(&nf_ct_net_ops);
        if (ret)
                inet_frags_fini(&nf_frags);
 
+out:
        return ret;
 }