From: Florian Westphal <fw@strlen.de>
To: Bart De Schuymer <bdschuym@pandora.be>
Cc: Florian Westphal <fw@strlen.de>,
netfilter-devel@vger.kernel.org, Jiri Pirko <jpirko@redhat.com>,
Jesse Gross <jesse@nicira.com>
Subject: Re: [PATCH] bridge: netfilter: don't call iptables on vlan packets if sysctl is off
Date: Sat, 3 Mar 2012 11:20:21 +0100 [thread overview]
Message-ID: <20120303102021.GE11311@Chamillionaire.breakpoint.cc> (raw)
In-Reply-To: <4F51376F.3050704@pandora.be>
Bart De Schuymer <bdschuym@pandora.be> wrote:
> Op 1/03/2012 22:42, Florian Westphal schreef:
> > When net.bridge.bridge-nf-filter-vlan-tagged is 0 (default), vlan packets
> > arriving should not be sent to ip(6)tables by bridge netfilter.
> >
> > However, it turns out that we currently always send VLAN packets to
> > netfilter, if ..
> > a), CONFIG_VLAN_8021Q is enabled ; or
> > b), CONFIG_VLAN_8021Q is not set but rx vlan offload is enabled
> > on the bridge port.
> >
> > This is because bridge netfilter treats skb with
> > skb->protocol == ETH_P_IP{V6} as "non-vlan packet".
>
> > - else if (skb->protocol == htons(ETH_P_IPV6) || IS_VLAN_IPV6(skb) ||
> > - IS_PPPOE_IPV6(skb))
> > + else if (IS_IPV6(skb) || IS_PPPOE_IPV6(skb))
>
> > - if (skb->protocol != htons(ETH_P_ARP)) {
> > - if (!IS_VLAN_ARP(skb))
> > - return NF_ACCEPT;
> > - nf_bridge_pull_encap_header(skb);
> > - }
> > + if (!IS_ARP(skb))
> > + return NF_ACCEPT;
> > + nf_bridge_pull_encap_header(skb);
>
> > - if (skb->protocol == htons(ETH_P_IP) || IS_VLAN_IP(skb) ||
> > - IS_PPPOE_IP(skb))
> > + if (IS_IP(skb) || IS_PPPOE_IP(skb))
>
> I think the above is quite unclear to read. I would prefer something
> like this:
> if (IS_IP(skb) || IS_VLAN_IP(skb) || IS_PPPOE_IP(skb))
I disagree. But fair enough, I'll change it & respin on monday, if...
> The compiler should easily remove any redundant checks that this would
> produce.
... gcc removes the redundant checks (I expect it to).
> Apart from that the patch looks fine to me.
Thanks for reviewing!
Regards,
Florian
prev parent reply other threads:[~2012-03-03 10:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-01 21:42 [PATCH] bridge: netfilter: don't call iptables on vlan packets if sysctl is off Florian Westphal
2012-03-02 21:11 ` Bart De Schuymer
2012-03-03 10:20 ` Florian Westphal [this message]
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=20120303102021.GE11311@Chamillionaire.breakpoint.cc \
--to=fw@strlen.de \
--cc=bdschuym@pandora.be \
--cc=jesse@nicira.com \
--cc=jpirko@redhat.com \
--cc=netfilter-devel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).