]> err.no Git - linux-2.6/blobdiff - net/ipv4/netfilter/ipt_MASQUERADE.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
[linux-2.6] / net / ipv4 / netfilter / ipt_MASQUERADE.c
index 846a0e7272184d11cb198e23f6185613f22d5946..3e0b562b2db704571b044b928e6bea712b9167b7 100644 (file)
@@ -27,12 +27,6 @@ MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>");
 MODULE_DESCRIPTION("iptables MASQUERADE target module");
 
-#if 0
-#define DEBUGP printk
-#else
-#define DEBUGP(format, args...)
-#endif
-
 /* Lock protects masq region inside conntrack */
 static DEFINE_RWLOCK(masq_lock);
 
@@ -47,11 +41,11 @@ masquerade_check(const char *tablename,
        const struct nf_nat_multi_range_compat *mr = targinfo;
 
        if (mr->range[0].flags & IP_NAT_RANGE_MAP_IPS) {
-               DEBUGP("masquerade_check: bad MAP_IPS.\n");
+               pr_debug("masquerade_check: bad MAP_IPS.\n");
                return false;
        }
        if (mr->rangesize != 1) {
-               DEBUGP("masquerade_check: bad rangesize %u.\n", mr->rangesize);
+               pr_debug("masquerade_check: bad rangesize %u\n", mr->rangesize);
                return false;
        }
        return true;
@@ -109,7 +103,7 @@ masquerade_target(struct sk_buff **pskb,
        return nf_nat_setup_info(ct, &newrange, hooknum);
 }
 
-static inline int
+static int
 device_cmp(struct nf_conn *i, void *ifindex)
 {
        const struct nf_conn_nat *nat = nfct_nat(i);
@@ -131,6 +125,9 @@ static int masq_device_event(struct notifier_block *this,
 {
        const struct net_device *dev = ptr;
 
+       if (dev->nd_net != &init_net)
+               return NOTIFY_DONE;
+
        if (event == NETDEV_DOWN) {
                /* Device was downed.  Search entire table for
                   conntracks which were associated with that device,
@@ -169,7 +166,7 @@ static struct notifier_block masq_inet_notifier = {
        .notifier_call  = masq_inet_event,
 };
 
-static struct xt_target masquerade = {
+static struct xt_target masquerade __read_mostly = {
        .name           = "MASQUERADE",
        .family         = AF_INET,
        .target         = masquerade_target,