Commit 51efbcbbb29708f8b588fda6cca42d26710f14fd
Committed by
Simon Horman
1 parent
5703294874
ipvs: Simplify ipvs and net access in ip_vs_leave
Stop using the hack skb_net(skb) to compute the network namespace. 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>
Showing 1 changed file with 2 additions and 6 deletions Side-by-side Diff
net/netfilter/ipvs/ip_vs_core.c
... | ... | @@ -568,21 +568,17 @@ |
568 | 568 | struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph) |
569 | 569 | { |
570 | 570 | __be16 _ports[2], *pptr, dport; |
571 | - struct net *net; | |
572 | - struct netns_ipvs *ipvs; | |
571 | + struct netns_ipvs *ipvs = svc->ipvs; | |
572 | + struct net *net = ipvs->net; | |
573 | 573 | |
574 | 574 | pptr = frag_safe_skb_hp(skb, iph->len, sizeof(_ports), _ports, iph); |
575 | 575 | if (!pptr) |
576 | 576 | return NF_DROP; |
577 | 577 | dport = likely(!ip_vs_iph_inverse(iph)) ? pptr[1] : pptr[0]; |
578 | 578 | |
579 | - net = skb_net(skb); | |
580 | - | |
581 | - | |
582 | 579 | /* if it is fwmark-based service, the cache_bypass sysctl is up |
583 | 580 | and the destination is a non-local unicast, then create |
584 | 581 | a cache_bypass connection entry */ |
585 | - ipvs = net_ipvs(net); | |
586 | 582 | if (sysctl_cache_bypass(ipvs) && svc->fwmark && |
587 | 583 | !(iph->hdr_flags & (IP_VS_HDR_INVERSE | IP_VS_HDR_ICMP)) && |
588 | 584 | ip_vs_addr_is_unicast(net, svc->af, &iph->daddr)) { |