]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/netfilter/iptable_filter.c
[NETFILTER]: nf_log: constify struct nf_logger and nf_log_packet loginfo arg
[linux-2.6-omap-h63xx.git] / net / ipv4 / netfilter / iptable_filter.c
index 4f51c1d7d2d60910de959be5554f01ca6bbcd664..29bb4f9fbda0f7f7d4fcc5cce744e557907f0e86 100644 (file)
@@ -19,7 +19,9 @@ MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>");
 MODULE_DESCRIPTION("iptables filter table");
 
-#define FILTER_VALID_HOOKS ((1 << NF_IP_LOCAL_IN) | (1 << NF_IP_FORWARD) | (1 << NF_IP_LOCAL_OUT))
+#define FILTER_VALID_HOOKS ((1 << NF_INET_LOCAL_IN) | \
+                           (1 << NF_INET_FORWARD) | \
+                           (1 << NF_INET_LOCAL_OUT))
 
 static struct
 {
@@ -33,14 +35,14 @@ static struct
                .num_entries = 4,
                .size = sizeof(struct ipt_standard) * 3 + sizeof(struct ipt_error),
                .hook_entry = {
-                       [NF_IP_LOCAL_IN] = 0,
-                       [NF_IP_FORWARD] = sizeof(struct ipt_standard),
-                       [NF_IP_LOCAL_OUT] = sizeof(struct ipt_standard) * 2,
+                       [NF_INET_LOCAL_IN] = 0,
+                       [NF_INET_FORWARD] = sizeof(struct ipt_standard),
+                       [NF_INET_LOCAL_OUT] = sizeof(struct ipt_standard) * 2,
                },
                .underflow = {
-                       [NF_IP_LOCAL_IN] = 0,
-                       [NF_IP_FORWARD] = sizeof(struct ipt_standard),
-                       [NF_IP_LOCAL_OUT] = sizeof(struct ipt_standard) * 2,
+                       [NF_INET_LOCAL_IN] = 0,
+                       [NF_INET_FORWARD] = sizeof(struct ipt_standard),
+                       [NF_INET_LOCAL_OUT] = sizeof(struct ipt_standard) * 2,
                },
        },
        .entries = {
@@ -62,53 +64,53 @@ static struct xt_table packet_filter = {
 /* The work comes in here from netfilter.c. */
 static unsigned int
 ipt_hook(unsigned int hook,
-        struct sk_buff **pskb,
+        struct sk_buff *skb,
         const struct net_device *in,
         const struct net_device *out,
         int (*okfn)(struct sk_buff *))
 {
-       return ipt_do_table(pskb, hook, in, out, &packet_filter);
+       return ipt_do_table(skb, hook, in, out, &packet_filter);
 }
 
 static unsigned int
 ipt_local_out_hook(unsigned int hook,
-                  struct sk_buff **pskb,
+                  struct sk_buff *skb,
                   const struct net_device *in,
                   const struct net_device *out,
                   int (*okfn)(struct sk_buff *))
 {
        /* root is playing with raw sockets. */
-       if ((*pskb)->len < sizeof(struct iphdr)
-           || ip_hdrlen(*pskb) < sizeof(struct iphdr)) {
+       if (skb->len < sizeof(struct iphdr) ||
+           ip_hdrlen(skb) < sizeof(struct iphdr)) {
                if (net_ratelimit())
                        printk("iptable_filter: ignoring short SOCK_RAW "
                               "packet.\n");
                return NF_ACCEPT;
        }
 
-       return ipt_do_table(pskb, hook, in, out, &packet_filter);
+       return ipt_do_table(skb, hook, in, out, &packet_filter);
 }
 
-static struct nf_hook_ops ipt_ops[] = {
+static struct nf_hook_ops ipt_ops[] __read_mostly = {
        {
                .hook           = ipt_hook,
                .owner          = THIS_MODULE,
                .pf             = PF_INET,
-               .hooknum        = NF_IP_LOCAL_IN,
+               .hooknum        = NF_INET_LOCAL_IN,
                .priority       = NF_IP_PRI_FILTER,
        },
        {
                .hook           = ipt_hook,
                .owner          = THIS_MODULE,
                .pf             = PF_INET,
-               .hooknum        = NF_IP_FORWARD,
+               .hooknum        = NF_INET_FORWARD,
                .priority       = NF_IP_PRI_FILTER,
        },
        {
                .hook           = ipt_local_out_hook,
                .owner          = THIS_MODULE,
                .pf             = PF_INET,
-               .hooknum        = NF_IP_LOCAL_OUT,
+               .hooknum        = NF_INET_LOCAL_OUT,
                .priority       = NF_IP_PRI_FILTER,
        },
 };