From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vasily Averin Subject: [PATCH RFC v2 05/11] br_netfilter: switch sysctls call_iptables and call_ip6tables to init_brnf_net Date: Mon, 12 May 2014 16:57:22 +0400 Message-ID: <5370C532.6060401@parallels.com> References: <536FD0FD.8010204@pandora.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Florian Westphal , netfilter-devel@vger.kernel.org, Patrick McHardy , Pablo Neira Ayuso To: Bart De Schuymer Return-path: Received: from mailhub.sw.ru ([195.214.232.25]:24289 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758201AbaELM6c (ORCPT ); Mon, 12 May 2014 08:58:32 -0400 In-Reply-To: Sender: netfilter-devel-owner@vger.kernel.org List-ID: Signed-off-by: Vasily Averin --- net/bridge/br_netfilter.c | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-) diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index bd0746c..f34ed89 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c @@ -49,19 +49,17 @@ #ifdef CONFIG_SYSCTL static struct ctl_table_header *brnf_sysctl_header; -static int brnf_call_iptables __read_mostly = 1; -static int brnf_call_ip6tables __read_mostly = 1; static int brnf_filter_vlan_tagged __read_mostly = 0; static int brnf_filter_pppoe_tagged __read_mostly = 0; static int brnf_pass_vlan_indev __read_mostly = 0; #else -#define brnf_call_iptables 1 -#define brnf_call_ip6tables 1 #define brnf_filter_vlan_tagged 0 #define brnf_filter_pppoe_tagged 0 #define brnf_pass_vlan_indev 0 #endif #define brnf_call_arptables 1 +#define brnf_call_iptables 1 +#define brnf_call_ip6tables 1 #ifdef CONFIG_SYSCTL static struct brnf_net init_brnf_net = { @@ -707,14 +705,14 @@ static unsigned int br_nf_pre_routing(const struct nf_hook_ops *ops, br = p->br; if (IS_IPV6(skb) || IS_VLAN_IPV6(skb) || IS_PPPOE_IPV6(skb)) { - if (!brnf_call_ip6tables && !br->nf_call_ip6tables) + if (!brnf_flag(skb, call_ip6tables) && !br->nf_call_ip6tables) return NF_ACCEPT; nf_bridge_pull_encap_header_rcsum(skb); return br_nf_pre_routing_ipv6(ops, skb, in, out, okfn); } - if (!brnf_call_iptables && !br->nf_call_iptables) + if (!brnf_flag(skb, call_iptables) && !br->nf_call_iptables) return NF_ACCEPT; if (!IS_IP(skb) && !IS_VLAN_IP(skb) && !IS_PPPOE_IP(skb)) @@ -1039,14 +1037,14 @@ static struct ctl_table brnf_table[] = { }, { .procname = "bridge-nf-call-iptables", - .data = &brnf_call_iptables, + .data = &init_brnf_net.call_iptables, .maxlen = sizeof(int), .mode = 0644, .proc_handler = brnf_sysctl_call_tables, }, { .procname = "bridge-nf-call-ip6tables", - .data = &brnf_call_ip6tables, + .data = &init_brnf_net.call_ip6tables, .maxlen = sizeof(int), .mode = 0644, .proc_handler = brnf_sysctl_call_tables, -- 1.7.5.4