From patchwork Sun Sep 20 06:23:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Eric W. Biederman" X-Patchwork-Id: 519844 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 853CC14016A for ; Sun, 20 Sep 2015 16:35:22 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755296AbbITGfQ (ORCPT ); Sun, 20 Sep 2015 02:35:16 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:53204 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755240AbbITGes (ORCPT ); Sun, 20 Sep 2015 02:34:48 -0400 Received: from in02.mta.xmission.com ([166.70.13.52]) by out01.mta.xmission.com with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1ZdYD1-0007nr-Lv; Sun, 20 Sep 2015 00:34:47 -0600 Received: from 67-3-201-231.omah.qwest.net ([67.3.201.231] helo=x220.int.ebiederm.org) by in02.mta.xmission.com with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1ZdYBW-0007i8-0E; Sun, 20 Sep 2015 00:33:14 -0600 From: "Eric W. Biederman" To: Pablo Neira Ayuso , David Miller , Simon Horman Cc: netfilter-devel@vger.kernel.org, , Nicolas Dichtel , lvs-devel@vger.kernel.org Date: Sun, 20 Sep 2015 01:23:16 -0500 Message-Id: <1442730220-32458-60-git-send-email-ebiederm@xmission.com> X-Mailer: git-send-email 2.2.1 In-Reply-To: <87h9mplifu.fsf_-_@x220.int.ebiederm.org> References: <87h9mplifu.fsf_-_@x220.int.ebiederm.org> X-XM-AID: U2FsdGVkX18TxsI13BCakrrHh5ja63G9dF3kJdFwHw4= X-SA-Exim-Connect-IP: 67.3.201.231 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on sa01.xmission.com X-Spam-Level: ** X-Spam-Status: No, score=2.8 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE, TVD_RCVD_IP, T_TooManySym_01, TooManyTo_001, TooManyTo_002, XMGappySubj_01, XMGappySubj_02, XMSubLong autolearn=disabled version=3.4.0 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.5 TooManyTo_002 Multiple "To" Header Recipients 3x (uncommon) * 0.3 TooManyTo_001 Multiple "To" Header Recipients 2x (uncommon) * 1.0 XMGappySubj_02 Gappier still * 0.5 XMGappySubj_01 Very gappy subject * 0.7 XMSubLong Long Subject * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa01 1397; Body=1 Fuz1=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa01 1397; Body=1 Fuz1=1 X-Spam-Combo: **;Pablo Neira Ayuso , David Miller , Simon Horman X-Spam-Relay-Country: X-Spam-Timing: total 429 ms - load_scoreonly_sql: 0.06 (0.0%), signal_user_changed: 4.2 (1.0%), b_tie_ro: 3.0 (0.7%), parse: 1.15 (0.3%), extract_message_metadata: 25 (5.9%), get_uri_detail_list: 2.2 (0.5%), tests_pri_-1000: 10 (2.3%), tests_pri_-950: 2.0 (0.5%), tests_pri_-900: 1.62 (0.4%), tests_pri_-400: 25 (5.7%), check_bayes: 23 (5.3%), b_tokenize: 9 (2.2%), b_tok_get_all: 5 (1.2%), b_comp_prob: 2.6 (0.6%), b_tok_touch_all: 2.5 (0.6%), b_finish: 0.90 (0.2%), tests_pri_0: 348 (81.1%), tests_pri_500: 7 (1.6%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH next 60/84] ipvs: Pass ipvs into ip_vs_conn_fill_param_proto X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Wed, 24 Sep 2014 11:00:52 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org 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" --- net/netfilter/ipvs/ip_vs_conn.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c index 3917ea1b20df..3b1f57af739a 100644 --- a/net/netfilter/ipvs/ip_vs_conn.c +++ b/net/netfilter/ipvs/ip_vs_conn.c @@ -314,12 +314,12 @@ struct ip_vs_conn *ip_vs_conn_in_get(const struct ip_vs_conn_param *p) } 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, struct ip_vs_conn_param *p) { __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); if (pptr == NULL) @@ -338,9 +338,10 @@ struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, const struct ip_vs_iphdr *iph) { + struct netns_ipvs *ipvs = net_ipvs(skb_net(skb)); 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 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, const struct ip_vs_iphdr *iph) { + struct netns_ipvs *ipvs = net_ipvs(skb_net(skb)); 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 ip_vs_conn_out_get(&p);