netfilter: iptables: remove unused datalen variable
[safe/jmp/linux-2.6] / net / ipv4 / netfilter / ip_tables.c
index d91ecd4..3856aa3 100644 (file)
@@ -311,9 +311,10 @@ ipt_do_table(struct sk_buff *skb,
             const struct net_device *out,
             struct xt_table *table)
 {
+#define tb_comefrom ((struct ipt_entry *)table_base)->comefrom
+
        static const char nulldevname[IFNAMSIZ] __attribute__((aligned(sizeof(long))));
        const struct iphdr *ip;
-       u_int16_t datalen;
        bool hotdrop = false;
        /* Initializing verdict to NF_DROP keeps gcc happy. */
        unsigned int verdict = NF_DROP;
@@ -326,7 +327,6 @@ ipt_do_table(struct sk_buff *skb,
 
        /* Initialization */
        ip = ip_hdr(skb);
-       datalen = skb->len - ip->ihl * 4;
        indev = in ? in->name : nulldevname;
        outdev = out ? out->name : nulldevname;
        /* We handle fragments by dealing with the first fragment as
@@ -341,7 +341,7 @@ ipt_do_table(struct sk_buff *skb,
        mtpar.in      = tgpar.in  = in;
        mtpar.out     = tgpar.out = out;
        mtpar.family  = tgpar.family = NFPROTO_IPV4;
-       tgpar.hooknum = hook;
+       mtpar.hooknum = tgpar.hooknum = hook;
 
        IP_NF_ASSERT(table->valid_hooks & (1 << hook));
        xt_info_rdlock_bh();
@@ -409,23 +409,22 @@ ipt_do_table(struct sk_buff *skb,
                   abs. verdicts */
                tgpar.target   = t->u.kernel.target;
                tgpar.targinfo = t->data;
+
+
 #ifdef CONFIG_NETFILTER_DEBUG
-               ((struct ipt_entry *)table_base)->comefrom = 0xeeeeeeec;
+               tb_comefrom = 0xeeeeeeec;
 #endif
                verdict = t->u.kernel.target->target(skb, &tgpar);
 #ifdef CONFIG_NETFILTER_DEBUG
-               if (((struct ipt_entry *)table_base)->comefrom != 0xeeeeeeec &&
-                   verdict == IPT_CONTINUE) {
+               if (tb_comefrom != 0xeeeeeeec && verdict == IPT_CONTINUE) {
                        printk("Target %s reentered!\n",
                               t->u.kernel.target->name);
                        verdict = NF_DROP;
                }
-               ((struct ipt_entry *)table_base)->comefrom = 0x57acc001;
+               tb_comefrom = 0x57acc001;
 #endif
                /* Target might have changed stuff. */
                ip = ip_hdr(skb);
-               datalen = skb->len - ip->ihl * 4;
-
                if (verdict == IPT_CONTINUE)
                        e = ipt_next_entry(e);
                else
@@ -441,6 +440,8 @@ ipt_do_table(struct sk_buff *skb,
                return NF_DROP;
        else return verdict;
 #endif
+
+#undef tb_comefrom
 }
 
 /* Figures out from what hook each rule can be called: returns 0 if