]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv4/netfilter/ipt_NETMAP.c
[NETFILTER]: Introduce NF_INET_ hook values
[net-next-2.6.git] / net / ipv4 / netfilter / ipt_NETMAP.c
index 41a011d5a0655ae808be14343bfa9ce8a477f812..973bbee7ee1f41055e00217a017647e22b5bbca2 100644 (file)
@@ -43,7 +43,7 @@ check(const char *tablename,
 }
 
 static unsigned int
-target(struct sk_buff **pskb,
+target(struct sk_buff *skb,
        const struct net_device *in,
        const struct net_device *out,
        unsigned int hooknum,
@@ -56,17 +56,17 @@ target(struct sk_buff **pskb,
        const struct nf_nat_multi_range_compat *mr = targinfo;
        struct nf_nat_range newrange;
 
-       NF_CT_ASSERT(hooknum == NF_IP_PRE_ROUTING
-                    || hooknum == NF_IP_POST_ROUTING
-                    || hooknum == NF_IP_LOCAL_OUT);
-       ct = nf_ct_get(*pskb, &ctinfo);
+       NF_CT_ASSERT(hooknum == NF_INET_PRE_ROUTING
+                    || hooknum == NF_INET_POST_ROUTING
+                    || hooknum == NF_INET_LOCAL_OUT);
+       ct = nf_ct_get(skb, &ctinfo);
 
        netmask = ~(mr->range[0].min_ip ^ mr->range[0].max_ip);
 
-       if (hooknum == NF_IP_PRE_ROUTING || hooknum == NF_IP_LOCAL_OUT)
-               new_ip = ip_hdr(*pskb)->daddr & ~netmask;
+       if (hooknum == NF_INET_PRE_ROUTING || hooknum == NF_INET_LOCAL_OUT)
+               new_ip = ip_hdr(skb)->daddr & ~netmask;
        else
-               new_ip = ip_hdr(*pskb)->saddr & ~netmask;
+               new_ip = ip_hdr(skb)->saddr & ~netmask;
        new_ip |= mr->range[0].min_ip & netmask;
 
        newrange = ((struct nf_nat_range)
@@ -84,8 +84,9 @@ static struct xt_target target_module __read_mostly = {
        .target         = target,
        .targetsize     = sizeof(struct nf_nat_multi_range_compat),
        .table          = "nat",
-       .hooks          = (1 << NF_IP_PRE_ROUTING) | (1 << NF_IP_POST_ROUTING) |
-                         (1 << NF_IP_LOCAL_OUT),
+       .hooks          = (1 << NF_INET_PRE_ROUTING) |
+                         (1 << NF_INET_POST_ROUTING) |
+                         (1 << NF_INET_LOCAL_OUT),
        .checkentry     = check,
        .me             = THIS_MODULE
 };