Commit 6e385bb3 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Simon Horman

ipvs: Pass ipvs into ip_vs_in

Derive ipvs from state->net in the callers of ip_vs_in and pass it
into ip_vs_out.  Removing the need to use the hack skb_net.
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: default avatarJulian Anastasov <ja@ssi.bg>
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
parent 1b75097d
...@@ -1684,15 +1684,13 @@ static int ip_vs_in_icmp_v6(struct sk_buff *skb, int *related, ...@@ -1684,15 +1684,13 @@ static int ip_vs_in_icmp_v6(struct sk_buff *skb, int *related,
* and send it on its way... * and send it on its way...
*/ */
static unsigned int static unsigned int
ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af) ip_vs_in(struct netns_ipvs *ipvs, unsigned int hooknum, struct sk_buff *skb, int af)
{ {
struct net *net;
struct ip_vs_iphdr iph; struct ip_vs_iphdr iph;
struct ip_vs_protocol *pp; struct ip_vs_protocol *pp;
struct ip_vs_proto_data *pd; struct ip_vs_proto_data *pd;
struct ip_vs_conn *cp; struct ip_vs_conn *cp;
int ret, pkts; int ret, pkts;
struct netns_ipvs *ipvs;
int conn_reuse_mode; int conn_reuse_mode;
/* Already marked as IPVS request or reply? */ /* Already marked as IPVS request or reply? */
...@@ -1715,8 +1713,6 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af) ...@@ -1715,8 +1713,6 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af)
return NF_ACCEPT; return NF_ACCEPT;
} }
/* ipvs enabled in this netns ? */ /* ipvs enabled in this netns ? */
net = skb_net(skb);
ipvs = net_ipvs(net);
if (unlikely(sysctl_backup_only(ipvs) || !ipvs->enable)) if (unlikely(sysctl_backup_only(ipvs) || !ipvs->enable))
return NF_ACCEPT; return NF_ACCEPT;
...@@ -1844,7 +1840,7 @@ static unsigned int ...@@ -1844,7 +1840,7 @@ static unsigned int
ip_vs_remote_request4(void *priv, struct sk_buff *skb, ip_vs_remote_request4(void *priv, struct sk_buff *skb,
const struct nf_hook_state *state) const struct nf_hook_state *state)
{ {
return ip_vs_in(state->hook, skb, AF_INET); return ip_vs_in(net_ipvs(state->net), state->hook, skb, AF_INET);
} }
/* /*
...@@ -1855,7 +1851,7 @@ static unsigned int ...@@ -1855,7 +1851,7 @@ static unsigned int
ip_vs_local_request4(void *priv, struct sk_buff *skb, ip_vs_local_request4(void *priv, struct sk_buff *skb,
const struct nf_hook_state *state) const struct nf_hook_state *state)
{ {
return ip_vs_in(state->hook, skb, AF_INET); return ip_vs_in(net_ipvs(state->net), state->hook, skb, AF_INET);
} }
#ifdef CONFIG_IP_VS_IPV6 #ifdef CONFIG_IP_VS_IPV6
...@@ -1868,7 +1864,7 @@ static unsigned int ...@@ -1868,7 +1864,7 @@ static unsigned int
ip_vs_remote_request6(void *priv, struct sk_buff *skb, ip_vs_remote_request6(void *priv, struct sk_buff *skb,
const struct nf_hook_state *state) const struct nf_hook_state *state)
{ {
return ip_vs_in(state->hook, skb, AF_INET6); return ip_vs_in(net_ipvs(state->net), state->hook, skb, AF_INET6);
} }
/* /*
...@@ -1879,7 +1875,7 @@ static unsigned int ...@@ -1879,7 +1875,7 @@ static unsigned int
ip_vs_local_request6(void *priv, struct sk_buff *skb, ip_vs_local_request6(void *priv, struct sk_buff *skb,
const struct nf_hook_state *state) const struct nf_hook_state *state)
{ {
return ip_vs_in(state->hook, skb, AF_INET6); return ip_vs_in(net_ipvs(state->net), state->hook, skb, AF_INET6);
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment