struct rcu_head rcu;
};
-static LIST_HEAD(clusterip_configs);
-
/* clusterip_lock protects the clusterip_configs list */
static DEFINE_SPINLOCK(clusterip_lock);
static int clusterip_net_id __read_mostly;
struct clusterip_net {
+ struct list_head configs;
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *procdir;
#endif
__clusterip_config_find(__be32 clusterip)
{
struct clusterip_config *c;
+ struct clusterip_net *cn = net_generic(&init_net, clusterip_net_id);
- list_for_each_entry_rcu(c, &clusterip_configs, list) {
+ list_for_each_entry_rcu(c, &cn->configs, list) {
if (c->clusterip == clusterip)
return c;
}
#endif
spin_lock_bh(&clusterip_lock);
- list_add_rcu(&c->list, &clusterip_configs);
+ list_add_rcu(&c->list, &cn->configs);
spin_unlock_bh(&clusterip_lock);
return c;
static int clusterip_net_init(struct net *net)
{
-#ifdef CONFIG_PROC_FS
struct clusterip_net *cn = net_generic(net, clusterip_net_id);
+ INIT_LIST_HEAD(&cn->configs);
+
+#ifdef CONFIG_PROC_FS
cn->procdir = proc_mkdir("ipt_CLUSTERIP", net->proc_net);
if (!cn->procdir) {
pr_err("Unable to proc dir entry\n");