]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/netfilter/ipt_MASQUERADE.c
Pull acpi_bus_register_driver into release branch
[linux-2.6-omap-h63xx.git] / net / ipv4 / netfilter / ipt_MASQUERADE.c
index 27860510ca6dacb4464f65352b5f4e9c917c9921..8b3e7f99b8615e1e44b6951e0222e4358ca47d43 100644 (file)
@@ -40,26 +40,14 @@ static DEFINE_RWLOCK(masq_lock);
 /* FIXME: Multiple targets. --RR */
 static int
 masquerade_check(const char *tablename,
-                const struct ipt_entry *e,
+                const void *e,
+                const struct xt_target *target,
                 void *targinfo,
                 unsigned int targinfosize,
                 unsigned int hook_mask)
 {
        const struct ip_nat_multi_range_compat *mr = targinfo;
 
-       if (strcmp(tablename, "nat") != 0) {
-               DEBUGP("masquerade_check: bad table `%s'.\n", tablename);
-               return 0;
-       }
-       if (targinfosize != IPT_ALIGN(sizeof(*mr))) {
-               DEBUGP("masquerade_check: size %u != %u.\n",
-                      targinfosize, sizeof(*mr));
-               return 0;
-       }
-       if (hook_mask & ~(1 << NF_IP_POST_ROUTING)) {
-               DEBUGP("masquerade_check: bad hooks %x.\n", hook_mask);
-               return 0;
-       }
        if (mr->range[0].flags & IP_NAT_RANGE_MAP_IPS) {
                DEBUGP("masquerade_check: bad MAP_IPS.\n");
                return 0;
@@ -76,6 +64,7 @@ masquerade_target(struct sk_buff **pskb,
                  const struct net_device *in,
                  const struct net_device *out,
                  unsigned int hooknum,
+                 const struct xt_target *target,
                  const void *targinfo,
                  void *userinfo)
 {
@@ -179,11 +168,14 @@ static struct notifier_block masq_inet_notifier = {
 static struct ipt_target masquerade = {
        .name           = "MASQUERADE",
        .target         = masquerade_target,
+       .targetsize     = sizeof(struct ip_nat_multi_range_compat),
+       .table          = "nat",
+       .hooks          = 1 << NF_IP_POST_ROUTING,
        .checkentry     = masquerade_check,
        .me             = THIS_MODULE,
 };
 
-static int __init init(void)
+static int __init ipt_masquerade_init(void)
 {
        int ret;
 
@@ -199,12 +191,12 @@ static int __init init(void)
        return ret;
 }
 
-static void __exit fini(void)
+static void __exit ipt_masquerade_fini(void)
 {
        ipt_unregister_target(&masquerade);
        unregister_netdevice_notifier(&masq_dev_notifier);
        unregister_inetaddr_notifier(&masq_inet_notifier);      
 }
 
-module_init(init);
-module_exit(fini);
+module_init(ipt_masquerade_init);
+module_exit(ipt_masquerade_fini);