From: Bart De Schuymer <bdschuym@pandora.be>
To: Richard Weinberger <richard@nod.at>
Cc: netdev@vger.kernel.org, bridge@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org,
Stephen Hemminger <shemminger@vyatta.com>,
davem@davemloft.net
Subject: Re: [Bridge] [PATCH] netfilter: Fix br_nf_pre_routing() in conjunction with bridge-nf-call-ip(6)tables=0
Date: Tue, 03 Jan 2012 21:15:19 +0100 [thread overview]
Message-ID: <4F0361D7.3000602@pandora.be> (raw)
In-Reply-To: <4F033E11.5060707@nod.at>
Op 3/01/2012 18:42, Richard Weinberger schreef:
> Am 03.01.2012 17:15, schrieb Stephen Hemminger:
>> On Tue, 3 Jan 2012 14:26:04 +0100
>> Richard Weinberger<richard@nod.at> wrote:
>>
>>> If net.bridge.bridge-nf-call-iptables or net.bridge.bridge-nf-call-ip6tables
>>> are set to zero xt_physdev has no effect because skb->nf_bridge has not been set up.
>>>
>>> Signed-off-by: Richard Weinberger<richard@nod.at>
>> I am not sure if this is a valid configuration. The setting of sysctl is saying
>> "don't do iptables on bridge (since I won't be using it)" and then you are later
>> doing iptables and expecting the settings as if the iptables setup was being
>> done.
> I don't think so.
>
> Also rules like this one are broken:
> iptables -A INPUT -i bridge0 -m physdev --physdev-in eth0 -j ...
>
> No firewalling is done on the bridge, xt_physdev is only using some meta
> information.
>
> At least a big fat warning would be nice that xt_physdev does not work
> if bridge-nf-call-iptables=0.
> It took me some time to figure out why my firewall rule set gone nuts on
> RHEL6...
The documentation is probably not explicit enough, but I would keep the
behavior as it is now. Setting bridge-nf-call-iptables to 0 makes
iptables behave as if bridge-netfilter was not enabled at compilation.
Anyway, your patch is almost certainly flawed since the fact that
skb->nf_bridge can be NULL is used as part of the logic in
br_netfilter.c: it indicates that bridge-nf-call-iptables was 0 when the
packet was first processed by bridge-netfilter and should therefore not
be given to iptables in any other netfilter hook.
cheers,
Bart
--
Bart De Schuymer
www.artinalgorithms.be
WARNING: multiple messages have this Message-ID (diff)
From: Bart De Schuymer <bdschuym@pandora.be>
To: Richard Weinberger <richard@nod.at>
Cc: Stephen Hemminger <shemminger@vyatta.com>,
davem@davemloft.net, bridge@lists.linux-foundation.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] netfilter: Fix br_nf_pre_routing() in conjunction with bridge-nf-call-ip(6)tables=0
Date: Tue, 03 Jan 2012 21:15:19 +0100 [thread overview]
Message-ID: <4F0361D7.3000602@pandora.be> (raw)
In-Reply-To: <4F033E11.5060707@nod.at>
Op 3/01/2012 18:42, Richard Weinberger schreef:
> Am 03.01.2012 17:15, schrieb Stephen Hemminger:
>> On Tue, 3 Jan 2012 14:26:04 +0100
>> Richard Weinberger<richard@nod.at> wrote:
>>
>>> If net.bridge.bridge-nf-call-iptables or net.bridge.bridge-nf-call-ip6tables
>>> are set to zero xt_physdev has no effect because skb->nf_bridge has not been set up.
>>>
>>> Signed-off-by: Richard Weinberger<richard@nod.at>
>> I am not sure if this is a valid configuration. The setting of sysctl is saying
>> "don't do iptables on bridge (since I won't be using it)" and then you are later
>> doing iptables and expecting the settings as if the iptables setup was being
>> done.
> I don't think so.
>
> Also rules like this one are broken:
> iptables -A INPUT -i bridge0 -m physdev --physdev-in eth0 -j ...
>
> No firewalling is done on the bridge, xt_physdev is only using some meta
> information.
>
> At least a big fat warning would be nice that xt_physdev does not work
> if bridge-nf-call-iptables=0.
> It took me some time to figure out why my firewall rule set gone nuts on
> RHEL6...
The documentation is probably not explicit enough, but I would keep the
behavior as it is now. Setting bridge-nf-call-iptables to 0 makes
iptables behave as if bridge-netfilter was not enabled at compilation.
Anyway, your patch is almost certainly flawed since the fact that
skb->nf_bridge can be NULL is used as part of the logic in
br_netfilter.c: it indicates that bridge-nf-call-iptables was 0 when the
packet was first processed by bridge-netfilter and should therefore not
be given to iptables in any other netfilter hook.
cheers,
Bart
--
Bart De Schuymer
www.artinalgorithms.be
next prev parent reply other threads:[~2012-01-03 20:15 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-03 1:29 xt_physdev has no effect if net.bridge.bridge-nf-call-iptables=0 Richard Weinberger
2012-01-03 13:26 ` [Bridge] " Richard Weinberger
2012-01-03 13:26 ` Richard Weinberger
2012-01-03 13:26 ` [Bridge] [PATCH] netfilter: Fix br_nf_pre_routing() in conjunction with bridge-nf-call-ip(6)tables=0 Richard Weinberger
2012-01-03 13:26 ` Richard Weinberger
2012-01-03 16:15 ` [Bridge] " Stephen Hemminger
2012-01-03 16:15 ` Stephen Hemminger
2012-01-03 17:42 ` [Bridge] " Richard Weinberger
2012-01-03 17:42 ` Richard Weinberger
2012-01-03 20:15 ` Bart De Schuymer [this message]
2012-01-03 20:15 ` Bart De Schuymer
2012-01-03 20:29 ` [Bridge] " Richard Weinberger
2012-01-03 20:29 ` Richard Weinberger
2012-01-04 17:55 ` [Bridge] " Bart De Schuymer
2012-01-04 17:55 ` Bart De Schuymer
2012-01-04 23:13 ` [Bridge] " Richard Weinberger
2012-01-04 23:13 ` Richard Weinberger
2012-01-05 19:50 ` [Bridge] " Bart De Schuymer
2012-01-05 19:50 ` Bart De Schuymer
2012-01-05 19:50 ` Bart De Schuymer
2012-01-05 19:54 ` [Bridge] " Richard Weinberger
2012-01-05 19:54 ` Richard Weinberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F0361D7.3000602@pandora.be \
--to=bdschuym@pandora.be \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=richard@nod.at \
--cc=shemminger@vyatta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.