]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/netfilter/ipt_CLUSTERIP.c
[IPV4]: Change ip_defrag to return an integer
[linux-2.6-omap-h63xx.git] / net / ipv4 / netfilter / ipt_CLUSTERIP.c
index 1981acedbfe819613c3e42c4ad68a2180da6fbb0..27f14e1ebd8b342ff3a8f556c3d990cb665e6540 100644 (file)
 #include <linux/udp.h>
 #include <linux/icmp.h>
 #include <linux/if_arp.h>
-#include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/netfilter_arp.h>
 #include <linux/netfilter/x_tables.h>
 #include <linux/netfilter_ipv4/ip_tables.h>
 #include <linux/netfilter_ipv4/ipt_CLUSTERIP.h>
 #include <net/netfilter/nf_conntrack.h>
+#include <net/net_namespace.h>
 #include <net/checksum.h>
 
 #define CLUSTERIP_VERSION "0.8"
 
-#define DEBUG_CLUSTERIP
-
-#ifdef DEBUG_CLUSTERIP
-#define DEBUGP printk
-#else
-#define DEBUGP
-#endif
-
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>");
 MODULE_DESCRIPTION("iptables target for CLUSTERIP");
@@ -351,15 +343,15 @@ target(struct sk_buff **pskb,
                        break;
        }
 
-#ifdef DEBUG_CLUSTERP
+#ifdef DEBUG
        DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
 #endif
-       DEBUGP("hash=%u ct_hash=%u ", hash, ct->mark);
+       pr_debug("hash=%u ct_hash=%u ", hash, ct->mark);
        if (!clusterip_responsible(cipinfo->config, hash)) {
-               DEBUGP("not responsible\n");
+               pr_debug("not responsible\n");
                return NF_DROP;
        }
-       DEBUGP("responsible\n");
+       pr_debug("responsible\n");
 
        /* despite being received via linklayer multicast, this is
         * actually a unicast IP packet. TCP doesn't like PACKET_MULTICAST */
@@ -409,7 +401,7 @@ checkentry(const char *tablename,
                                return false;
                        }
 
-                       dev = dev_get_by_name(e->ip.iniface);
+                       dev = dev_get_by_name(&init_net, e->ip.iniface);
                        if (!dev) {
                                printk(KERN_WARNING "CLUSTERIP: no such interface %s\n", e->ip.iniface);
                                return false;
@@ -490,7 +482,7 @@ struct arp_payload {
        __be32 dst_ip;
 } __attribute__ ((packed));
 
-#ifdef CLUSTERIP_DEBUG
+#ifdef DEBUG
 static void arp_print(struct arp_payload *payload)
 {
 #define HBUFFERLEN 30
@@ -546,8 +538,9 @@ arp_mangle(unsigned int hook,
         * this wouldn't work, since we didn't subscribe the mcast group on
         * other interfaces */
        if (c->dev != out) {
-               DEBUGP("CLUSTERIP: not mangling arp reply on different "
-                      "interface: cip'%s'-skb'%s'\n", c->dev->name, out->name);
+               pr_debug("CLUSTERIP: not mangling arp reply on different "
+                        "interface: cip'%s'-skb'%s'\n",
+                        c->dev->name, out->name);
                clusterip_config_put(c);
                return NF_ACCEPT;
        }
@@ -555,8 +548,8 @@ arp_mangle(unsigned int hook,
        /* mangle reply hardware address */
        memcpy(payload->src_hw, c->clustermac, arp->ar_hln);
 
-#ifdef CLUSTERIP_DEBUG
-       DEBUGP(KERN_DEBUG "CLUSTERIP mangled arp reply: ");
+#ifdef DEBUG
+       pr_debug(KERN_DEBUG "CLUSTERIP mangled arp reply: ");
        arp_print(payload);
 #endif
 
@@ -646,7 +639,7 @@ static int clusterip_seq_show(struct seq_file *s, void *v)
        return 0;
 }
 
-static struct seq_operations clusterip_seq_ops = {
+static const struct seq_operations clusterip_seq_ops = {
        .start  = clusterip_seq_start,
        .next   = clusterip_seq_next,
        .stop   = clusterip_seq_stop,
@@ -734,7 +727,7 @@ static int __init ipt_clusterip_init(void)
                goto cleanup_target;
 
 #ifdef CONFIG_PROC_FS
-       clusterip_procdir = proc_mkdir("ipt_CLUSTERIP", proc_net);
+       clusterip_procdir = proc_mkdir("ipt_CLUSTERIP", init_net.proc_net);
        if (!clusterip_procdir) {
                printk(KERN_ERR "CLUSTERIP: Unable to proc dir entry\n");
                ret = -ENOMEM;