From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric W. Biederman" Subject: [PATCH next 73/84] ipvs: Simplify ipvs and net access in ip_vs_leave Date: Mon, 21 Sep 2015 13:02:50 -0500 Message-ID: <1442858581-15869-73-git-send-email-ebiederm@xmission.com> References: <8737y7irc8.fsf_-_@x220.int.ebiederm.org> Cc: netfilter-devel@vger.kernel.org, , Nicolas Dichtel , lvs-devel@vger.kernel.org, Julian Anastasov To: Pablo Neira Ayuso , David Miller , Simon Horman Return-path: Received: from out03.mta.xmission.com ([166.70.13.233]:33504 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756648AbbIUSOF (ORCPT ); Mon, 21 Sep 2015 14:14:05 -0400 In-Reply-To: <8737y7irc8.fsf_-_@x220.int.ebiederm.org> Sender: netdev-owner@vger.kernel.org List-ID: Stop using the hack skb_net(skb) to compute the network namespace. Signed-off-by: "Eric W. Biederman" --- net/netfilter/ipvs/ip_vs_core.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c index 7e9ee1dece19..15661691bf7d 100644 --- a/net/netfilter/ipvs/ip_vs_core.c +++ b/net/netfilter/ipvs/ip_vs_core.c @@ -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) { __be16 _ports[2], *pptr, dport; - struct net *net; - struct netns_ipvs *ipvs; + struct netns_ipvs *ipvs = svc->ipvs; + struct net *net = ipvs->net; pptr = frag_safe_skb_hp(skb, iph->len, sizeof(_ports), _ports, iph); if (!pptr) return NF_DROP; 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 and the destination is a non-local unicast, then create a cache_bypass connection entry */ - ipvs = net_ipvs(net); if (sysctl_cache_bypass(ipvs) && svc->fwmark && !(iph->hdr_flags & (IP_VS_HDR_INVERSE | IP_VS_HDR_ICMP)) && ip_vs_addr_is_unicast(net, svc->af, &iph->daddr)) { -- 2.2.1