]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv6/netfilter/nf_conntrack_reasm.c
[NETFILTER]: nf_conntrack: use bool type in struct nf_conntrack_l3proto
[linux-2.6-omap-h63xx.git] / net / ipv6 / netfilter / nf_conntrack_reasm.c
index 2a0d698b24d5b3404305c1ebacb7306080bd0a52..2dccad48058c4e000ba37efca6d6ba389520c6ac 100644 (file)
@@ -103,8 +103,8 @@ struct ctl_table nf_ct_ipv6_sysctl_table[] = {
 };
 #endif
 
-static unsigned int ip6qhashfn(__be32 id, struct in6_addr *saddr,
-                              struct in6_addr *daddr)
+static unsigned int ip6qhashfn(__be32 id, const struct in6_addr *saddr,
+                              const struct in6_addr *daddr)
 {
        u32 a, b, c;
 
@@ -132,7 +132,7 @@ static unsigned int ip6qhashfn(__be32 id, struct in6_addr *saddr,
 
 static unsigned int nf_hashfn(struct inet_frag_queue *q)
 {
-       struct nf_ct_frag6_queue *nq;
+       const struct nf_ct_frag6_queue *nq;
 
        nq = container_of(q, struct nf_ct_frag6_queue, q);
        return ip6qhashfn(nq->id, &nq->saddr, &nq->daddr);
@@ -171,7 +171,9 @@ static __inline__ void fq_kill(struct nf_ct_frag6_queue *fq)
 
 static void nf_ct_frag6_evictor(void)
 {
+       local_bh_disable();
        inet_frag_evictor(&nf_init_frags, &nf_frags);
+       local_bh_enable();
 }
 
 static void nf_ct_frag6_expire(unsigned long data)
@@ -183,7 +185,7 @@ static void nf_ct_frag6_expire(unsigned long data)
 
        spin_lock(&fq->q.lock);
 
-       if (fq->q.last_in & COMPLETE)
+       if (fq->q.last_in & INET_FRAG_COMPLETE)
                goto out;
 
        fq_kill(fq);
@@ -220,12 +222,12 @@ oom:
 
 
 static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb,
-                            struct frag_hdr *fhdr, int nhoff)
+                            const struct frag_hdr *fhdr, int nhoff)
 {
        struct sk_buff *prev, *next;
        int offset, end;
 
-       if (fq->q.last_in & COMPLETE) {
+       if (fq->q.last_in & INET_FRAG_COMPLETE) {
                pr_debug("Allready completed\n");
                goto err;
        }
@@ -252,11 +254,11 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb,
                 * or have different end, the segment is corrupted.
                 */
                if (end < fq->q.len ||
-                   ((fq->q.last_in & LAST_IN) && end != fq->q.len)) {
+                   ((fq->q.last_in & INET_FRAG_LAST_IN) && end != fq->q.len)) {
                        pr_debug("already received last fragment\n");
                        goto err;
                }
-               fq->q.last_in |= LAST_IN;
+               fq->q.last_in |= INET_FRAG_LAST_IN;
                fq->q.len = end;
        } else {
                /* Check if the fragment is rounded to 8 bytes.
@@ -271,7 +273,7 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb,
                }
                if (end > fq->q.len) {
                        /* Some bits beyond end -> corruption. */
-                       if (fq->q.last_in & LAST_IN) {
+                       if (fq->q.last_in & INET_FRAG_LAST_IN) {
                                pr_debug("last packet already reached.\n");
                                goto err;
                        }
@@ -383,7 +385,7 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb,
         */
        if (offset == 0) {
                fq->nhoffset = nhoff;
-               fq->q.last_in |= FIRST_IN;
+               fq->q.last_in |= INET_FRAG_FIRST_IN;
        }
        write_lock(&nf_frags.lock);
        list_move_tail(&fq->q.lru_list, &nf_init_frags.lru_list);
@@ -645,7 +647,8 @@ struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb)
                goto ret_orig;
        }
 
-       if (fq->q.last_in == (FIRST_IN|LAST_IN) && fq->q.meat == fq->q.len) {
+       if (fq->q.last_in == (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)
                        pr_debug("Can't reassemble fragmented packets\n");