diff options
author | Gao feng <gaofeng@cn.fujitsu.com> | 2013-09-25 03:38:47 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-10-17 04:48:16 -0400 |
commit | b5ef0f85bf76986e5076cd1e0820fa4e61325772 (patch) | |
tree | b8b738149915434c2f7c23a974e3edfa7aae107b /net/ipv4 | |
parent | f1e8077f490cff4253b197154bf2affaa0ca08e3 (diff) |
netfilter: ipt_CLUSTERIP: add parameter net in clusterip_config_find_get
Inorder to find clusterip_config in net namespace.
Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/netfilter/ipt_CLUSTERIP.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c index 1bf5aa3096c1..b7fc9d5e06df 100644 --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c | |||
@@ -122,10 +122,10 @@ clusterip_config_entry_put(struct clusterip_config *c) | |||
122 | } | 122 | } |
123 | 123 | ||
124 | static struct clusterip_config * | 124 | static struct clusterip_config * |
125 | __clusterip_config_find(__be32 clusterip) | 125 | __clusterip_config_find(struct net *net, __be32 clusterip) |
126 | { | 126 | { |
127 | struct clusterip_config *c; | 127 | struct clusterip_config *c; |
128 | struct clusterip_net *cn = net_generic(&init_net, clusterip_net_id); | 128 | struct clusterip_net *cn = net_generic(net, clusterip_net_id); |
129 | 129 | ||
130 | list_for_each_entry_rcu(c, &cn->configs, list) { | 130 | list_for_each_entry_rcu(c, &cn->configs, list) { |
131 | if (c->clusterip == clusterip) | 131 | if (c->clusterip == clusterip) |
@@ -136,12 +136,12 @@ __clusterip_config_find(__be32 clusterip) | |||
136 | } | 136 | } |
137 | 137 | ||
138 | static inline struct clusterip_config * | 138 | static inline struct clusterip_config * |
139 | clusterip_config_find_get(__be32 clusterip, int entry) | 139 | clusterip_config_find_get(struct net *net, __be32 clusterip, int entry) |
140 | { | 140 | { |
141 | struct clusterip_config *c; | 141 | struct clusterip_config *c; |
142 | 142 | ||
143 | rcu_read_lock_bh(); | 143 | rcu_read_lock_bh(); |
144 | c = __clusterip_config_find(clusterip); | 144 | c = __clusterip_config_find(net, clusterip); |
145 | if (c) { | 145 | if (c) { |
146 | if (unlikely(!atomic_inc_not_zero(&c->refcount))) | 146 | if (unlikely(!atomic_inc_not_zero(&c->refcount))) |
147 | c = NULL; | 147 | c = NULL; |
@@ -381,7 +381,7 @@ static int clusterip_tg_check(const struct xt_tgchk_param *par) | |||
381 | 381 | ||
382 | /* FIXME: further sanity checks */ | 382 | /* FIXME: further sanity checks */ |
383 | 383 | ||
384 | config = clusterip_config_find_get(e->ip.dst.s_addr, 1); | 384 | config = clusterip_config_find_get(&init_net, e->ip.dst.s_addr, 1); |
385 | if (!config) { | 385 | if (!config) { |
386 | if (!(cipinfo->flags & CLUSTERIP_FLAG_NEW)) { | 386 | if (!(cipinfo->flags & CLUSTERIP_FLAG_NEW)) { |
387 | pr_info("no config found for %pI4, need 'new'\n", | 387 | pr_info("no config found for %pI4, need 'new'\n", |
@@ -519,7 +519,7 @@ arp_mangle(unsigned int hook, | |||
519 | 519 | ||
520 | /* if there is no clusterip configuration for the arp reply's | 520 | /* if there is no clusterip configuration for the arp reply's |
521 | * source ip, we don't want to mangle it */ | 521 | * source ip, we don't want to mangle it */ |
522 | c = clusterip_config_find_get(payload->src_ip, 0); | 522 | c = clusterip_config_find_get(&init_net, payload->src_ip, 0); |
523 | if (!c) | 523 | if (!c) |
524 | return NF_ACCEPT; | 524 | return NF_ACCEPT; |
525 | 525 | ||