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>
This commit is contained in:
parent
5703294874
commit
51efbcbbb2
1 changed files with 2 additions and 6 deletions
|
@ -568,21 +568,17 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
|
||||||
struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph)
|
struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph)
|
||||||
{
|
{
|
||||||
__be16 _ports[2], *pptr, dport;
|
__be16 _ports[2], *pptr, dport;
|
||||||
struct net *net;
|
struct netns_ipvs *ipvs = svc->ipvs;
|
||||||
struct netns_ipvs *ipvs;
|
struct net *net = ipvs->net;
|
||||||
|
|
||||||
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)
|
if (!pptr)
|
||||||
return NF_DROP;
|
return NF_DROP;
|
||||||
dport = likely(!ip_vs_iph_inverse(iph)) ? pptr[1] : pptr[0];
|
dport = likely(!ip_vs_iph_inverse(iph)) ? pptr[1] : pptr[0];
|
||||||
|
|
||||||
net = skb_net(skb);
|
|
||||||
|
|
||||||
|
|
||||||
/* if it is fwmark-based service, the cache_bypass sysctl is up
|
/* if it is fwmark-based service, the cache_bypass sysctl is up
|
||||||
and the destination is a non-local unicast, then create
|
and the destination is a non-local unicast, then create
|
||||||
a cache_bypass connection entry */
|
a cache_bypass connection entry */
|
||||||
ipvs = net_ipvs(net);
|
|
||||||
if (sysctl_cache_bypass(ipvs) && svc->fwmark &&
|
if (sysctl_cache_bypass(ipvs) && svc->fwmark &&
|
||||||
!(iph->hdr_flags & (IP_VS_HDR_INVERSE | IP_VS_HDR_ICMP)) &&
|
!(iph->hdr_flags & (IP_VS_HDR_INVERSE | IP_VS_HDR_ICMP)) &&
|
||||||
ip_vs_addr_is_unicast(net, svc->af, &iph->daddr)) {
|
ip_vs_addr_is_unicast(net, svc->af, &iph->daddr)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue