Merge branch 'upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/ralf/upstrea...
[sfrench/cifs-2.6.git] / net / ipv4 / netfilter / ipt_CLUSTERIP.c
index b5de6bd3e43a4354adf196aae482568f82ee75d3..52926c8e3cc17266f29269cce5ed061c339d7115 100644 (file)
@@ -32,7 +32,7 @@
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>");
-MODULE_DESCRIPTION("iptables target for CLUSTERIP");
+MODULE_DESCRIPTION("Xtables: CLUSTERIP target");
 
 struct clusterip_config {
        struct list_head list;                  /* list of all configs */
@@ -76,13 +76,6 @@ clusterip_config_put(struct clusterip_config *c)
                kfree(c);
 }
 
-/* increase the count of entries(rules) using/referencing this config */
-static inline void
-clusterip_config_entry_get(struct clusterip_config *c)
-{
-       atomic_inc(&c->entries);
-}
-
 /* decrease the count of entries using/referencing this config.  If last
  * entry(rule) is removed, remove the config from lists, but don't free it
  * yet, since proc-files could still be holding references */
@@ -174,14 +167,13 @@ clusterip_config_init(struct ipt_clusterip_tgt_info *i, __be32 ip,
 
                /* create proc dir entry */
                sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip));
-               c->pde = create_proc_entry(buffer, S_IWUSR|S_IRUSR,
-                                          clusterip_procdir);
+               c->pde = proc_create(buffer, S_IWUSR|S_IRUSR,
+                                    clusterip_procdir, &clusterip_proc_fops);
                if (!c->pde) {
                        kfree(c);
                        return NULL;
                }
        }
-       c->pde->proc_fops = &clusterip_proc_fops;
        c->pde->data = c;
 #endif
 
@@ -273,7 +265,7 @@ clusterip_hashfn(const struct sk_buff *skb,
        }
 
        /* node numbers are 1..n, not 0..n */
-       return (hashval % config->num_total_nodes) + 1;
+       return (((u64)hashval * config->num_total_nodes) >> 32) + 1;
 }
 
 static inline int
@@ -414,7 +406,7 @@ clusterip_tg_check(const char *tablename, const void *e_void,
 
        if (nf_ct_l3proto_try_module_get(target->family) < 0) {
                printk(KERN_WARNING "can't load conntrack support for "
-                                   "proto=%d\n", target->family);
+                                   "proto=%u\n", target->family);
                return false;
        }
 
@@ -551,7 +543,7 @@ arp_mangle(unsigned int hook,
        return NF_ACCEPT;
 }
 
-static struct nf_hook_ops cip_arp_ops = {
+static struct nf_hook_ops cip_arp_ops __read_mostly = {
        .hook = arp_mangle,
        .pf = NF_ARP,
        .hooknum = NF_ARP_OUT,