netfilter: xtables: add struct xt_mtchk_param::net
[safe/jmp/linux-2.6] / net / ipv4 / netfilter / iptable_mangle.c
index 3929d20..fae78c3 100644 (file)
@@ -28,7 +28,7 @@ MODULE_DESCRIPTION("iptables mangle table");
                            (1 << NF_INET_POST_ROUTING))
 
 /* Ouch - five different hooks? Maybe this should be a config option..... -- BC */
-static struct
+static const struct
 {
        struct ipt_replace repl;
        struct ipt_standard entries[5];
@@ -64,12 +64,11 @@ static struct
        .term = IPT_ERROR_INIT,                 /* ERROR */
 };
 
-static struct xt_table packet_mangler = {
+static const struct xt_table packet_mangler = {
        .name           = "mangle",
        .valid_hooks    = MANGLE_VALID_HOOKS,
-       .lock           = __RW_LOCK_UNLOCKED(packet_mangler.lock),
        .me             = THIS_MODULE,
-       .af             = AF_INET,
+       .af             = NFPROTO_IPV4,
 };
 
 /* The work comes in here from netfilter.c. */
@@ -131,8 +130,8 @@ ipt_local_hook(unsigned int hook,
        u_int32_t mark;
 
        /* root is playing with raw sockets. */
-       if (skb->len < sizeof(struct iphdr)
-           || ip_hdrlen(skb) < sizeof(struct iphdr))
+       if (skb->len < sizeof(struct iphdr) ||
+           ip_hdrlen(skb) < sizeof(struct iphdr))
                return NF_ACCEPT;
 
        /* Save things which could affect route */
@@ -163,35 +162,35 @@ static struct nf_hook_ops ipt_ops[] __read_mostly = {
        {
                .hook           = ipt_pre_routing_hook,
                .owner          = THIS_MODULE,
-               .pf             = PF_INET,
+               .pf             = NFPROTO_IPV4,
                .hooknum        = NF_INET_PRE_ROUTING,
                .priority       = NF_IP_PRI_MANGLE,
        },
        {
                .hook           = ipt_local_in_hook,
                .owner          = THIS_MODULE,
-               .pf             = PF_INET,
+               .pf             = NFPROTO_IPV4,
                .hooknum        = NF_INET_LOCAL_IN,
                .priority       = NF_IP_PRI_MANGLE,
        },
        {
                .hook           = ipt_forward_hook,
                .owner          = THIS_MODULE,
-               .pf             = PF_INET,
+               .pf             = NFPROTO_IPV4,
                .hooknum        = NF_INET_FORWARD,
                .priority       = NF_IP_PRI_MANGLE,
        },
        {
                .hook           = ipt_local_hook,
                .owner          = THIS_MODULE,
-               .pf             = PF_INET,
+               .pf             = NFPROTO_IPV4,
                .hooknum        = NF_INET_LOCAL_OUT,
                .priority       = NF_IP_PRI_MANGLE,
        },
        {
                .hook           = ipt_post_routing_hook,
                .owner          = THIS_MODULE,
-               .pf             = PF_INET,
+               .pf             = NFPROTO_IPV4,
                .hooknum        = NF_INET_POST_ROUTING,
                .priority       = NF_IP_PRI_MANGLE,
        },