ipvs: Pass ipvs into ip_vs_conn_fill_param_proto
Move the ugly hack net_ipvs(skb_net(skb)) up a layer in the call stack so it is easier to remove. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au>
This commit is contained in:
parent
1281a9c2d1
commit
f5099dd4d9
1 changed files with 6 additions and 4 deletions
|
@ -314,12 +314,12 @@ struct ip_vs_conn *ip_vs_conn_in_get(const struct ip_vs_conn_param *p)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ip_vs_conn_fill_param_proto(int af, const struct sk_buff *skb,
|
ip_vs_conn_fill_param_proto(struct netns_ipvs *ipvs,
|
||||||
|
int af, const struct sk_buff *skb,
|
||||||
const struct ip_vs_iphdr *iph,
|
const struct ip_vs_iphdr *iph,
|
||||||
struct ip_vs_conn_param *p)
|
struct ip_vs_conn_param *p)
|
||||||
{
|
{
|
||||||
__be16 _ports[2], *pptr;
|
__be16 _ports[2], *pptr;
|
||||||
struct netns_ipvs *ipvs = net_ipvs(skb_net(skb));
|
|
||||||
|
|
||||||
pptr = frag_safe_skb_hp(skb, iph->len, sizeof(_ports), _ports, iph);
|
pptr = frag_safe_skb_hp(skb, iph->len, sizeof(_ports), _ports, iph);
|
||||||
if (pptr == NULL)
|
if (pptr == NULL)
|
||||||
|
@ -338,9 +338,10 @@ struct ip_vs_conn *
|
||||||
ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb,
|
ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb,
|
||||||
const struct ip_vs_iphdr *iph)
|
const struct ip_vs_iphdr *iph)
|
||||||
{
|
{
|
||||||
|
struct netns_ipvs *ipvs = net_ipvs(skb_net(skb));
|
||||||
struct ip_vs_conn_param p;
|
struct ip_vs_conn_param p;
|
||||||
|
|
||||||
if (ip_vs_conn_fill_param_proto(af, skb, iph, &p))
|
if (ip_vs_conn_fill_param_proto(ipvs, af, skb, iph, &p))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return ip_vs_conn_in_get(&p);
|
return ip_vs_conn_in_get(&p);
|
||||||
|
@ -442,9 +443,10 @@ struct ip_vs_conn *
|
||||||
ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb,
|
ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb,
|
||||||
const struct ip_vs_iphdr *iph)
|
const struct ip_vs_iphdr *iph)
|
||||||
{
|
{
|
||||||
|
struct netns_ipvs *ipvs = net_ipvs(skb_net(skb));
|
||||||
struct ip_vs_conn_param p;
|
struct ip_vs_conn_param p;
|
||||||
|
|
||||||
if (ip_vs_conn_fill_param_proto(af, skb, iph, &p))
|
if (ip_vs_conn_fill_param_proto(ipvs, af, skb, iph, &p))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return ip_vs_conn_out_get(&p);
|
return ip_vs_conn_out_get(&p);
|
||||||
|
|
Loading…
Add table
Reference in a new issue