[NETFILTER]: nf_queue: remove unused data pointer
[powerpc.git] / net / ipv4 / netfilter / nf_nat_core.c
index 56e93f6..746c2ef 100644 (file)
@@ -213,9 +213,9 @@ find_best_ips_proto(struct nf_conntrack_tuple *tuple,
        *var_ipp = htonl(minip + j % (maxip - minip + 1));
 }
 
-/* Manipulate the tuple into the range given.  For NF_IP_POST_ROUTING,
- * we change the source to map into the range.  For NF_IP_PRE_ROUTING
- * and NF_IP_LOCAL_OUT, we change the destination to map into the
+/* Manipulate the tuple into the range given.  For NF_INET_POST_ROUTING,
+ * we change the source to map into the range.  For NF_INET_PRE_ROUTING
+ * and NF_INET_LOCAL_OUT, we change the destination to map into the
  * range.  It might not be possible to get a unique tuple, but we try.
  * At worst (or if we race), we will end up with a final duplicate in
  * __ip_conntrack_confirm and drop the packet. */
@@ -293,10 +293,10 @@ nf_nat_setup_info(struct nf_conn *ct,
                }
        }
 
-       NF_CT_ASSERT(hooknum == NF_IP_PRE_ROUTING ||
-                    hooknum == NF_IP_POST_ROUTING ||
-                    hooknum == NF_IP_LOCAL_IN ||
-                    hooknum == NF_IP_LOCAL_OUT);
+       NF_CT_ASSERT(hooknum == NF_INET_PRE_ROUTING ||
+                    hooknum == NF_INET_POST_ROUTING ||
+                    hooknum == NF_INET_LOCAL_IN ||
+                    hooknum == NF_INET_LOCAL_OUT);
        BUG_ON(nf_nat_initialized(ct, maniptype));
 
        /* What we've got will look like inverse of reply. Normally
@@ -372,10 +372,10 @@ manip_pkt(u_int16_t proto,
        iph = (void *)skb->data + iphdroff;
 
        if (maniptype == IP_NAT_MANIP_SRC) {
-               nf_csum_replace4(&iph->check, iph->saddr, target->src.u3.ip);
+               csum_replace4(&iph->check, iph->saddr, target->src.u3.ip);
                iph->saddr = target->src.u3.ip;
        } else {
-               nf_csum_replace4(&iph->check, iph->daddr, target->dst.u3.ip);
+               csum_replace4(&iph->check, iph->daddr, target->dst.u3.ip);
                iph->daddr = target->dst.u3.ip;
        }
        return 1;
@@ -607,13 +607,10 @@ static void nf_nat_move_storage(struct nf_conn *conntrack, void *old)
        struct nf_conn_nat *new_nat = nf_ct_ext_find(conntrack, NF_CT_EXT_NAT);
        struct nf_conn_nat *old_nat = (struct nf_conn_nat *)old;
        struct nf_conn *ct = old_nat->ct;
-       unsigned int srchash;
 
-       if (!(ct->status & IPS_NAT_DONE_MASK))
+       if (!ct || !(ct->status & IPS_NAT_DONE_MASK))
                return;
 
-       srchash = hash_by_src(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
-
        write_lock_bh(&nf_nat_lock);
        hlist_replace_rcu(&old_nat->bysource, &new_nat->bysource);
        new_nat->ct = ct;
@@ -681,7 +678,7 @@ static int clean_nat(struct nf_conn *i, void *data)
 
        if (!nat)
                return 0;
-       memset(nat, 0, sizeof(nat));
+       memset(nat, 0, sizeof(*nat));
        i->status &= ~(IPS_NAT_MASK | IPS_NAT_DONE_MASK | IPS_SEQ_ADJUST);
        return 0;
 }