From: Florian Westphal <fw@strlen.de>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Florian Westphal <fw@strlen.de>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] netfilter: bridge: restore vlan tag when refragmenting
Date: Fri, 5 Jun 2015 16:55:46 +0200 [thread overview]
Message-ID: <20150605145546.GI11015@breakpoint.cc> (raw)
In-Reply-To: <1433515021.1895.57.camel@edumazet-glaptop2.roam.corp.google.com>
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
> > index 46660a2..0d9ad4a 100644
> > --- a/net/bridge/br_netfilter.c
> > +++ b/net/bridge/br_netfilter.c
> > @@ -115,6 +115,8 @@ struct brnf_frag_data {
> > char mac[NF_BRIDGE_MAX_MAC_HEADER_LENGTH];
> > u8 encap_size;
> > u8 size;
> > + u16 vlan_tci;
> > + __be16 vlan_proto;
> > };
> >
> > static DEFINE_PER_CPU(struct brnf_frag_data, brnf_frag_data_storage);
> > @@ -837,6 +839,11 @@ static int br_nf_push_frag_xmit(struct sock *sk, struct sk_buff *skb)
> > return 0;
> > }
> >
> > + if (data->vlan_tci) {
> > + skb->vlan_tci = data->vlan_tci;
> > + skb->vlan_proto = data->vlan_proto;
> > + }
> > +
> > skb_copy_to_linear_data_offset(skb, -data->size, data->mac, data->size);
> > __skb_push(skb, data->encap_size);
> >
> > @@ -890,6 +897,9 @@ static int br_nf_dev_queue_xmit(struct sock *sk, struct sk_buff *skb)
> > nf_bridge_update_protocol(skb);
> >
> > data = this_cpu_ptr(&brnf_frag_data_storage);
> > +
> > + data->vlan_tci = skb->vlan_tci;
> > + data->vlan_proto = skb->vlan_proto;
> > data->encap_size = nf_bridge_encap_header_len(skb);
> > data->size = ETH_HLEN + data->encap_size;
> >
>
> I am curious :
>
> IP defrag unit does not care about vlan, so how do we ensure all frags
> have same vlan characteristics ?
We don't. bridge-nf-filter-vlan-tagged=1 completely breaks isolation of VLANs.
(same goes for pppoe header stripping).
In retrospect it was a bad idea to add this feature.
I wouldn't be sad if we'd kill it instead of applying yet another crap
patch for this but I'm afraid that there are people out there that use it.
Perhaps adding TAINT_CRAP on vlan=1 change would be good idea :)
[ Its off by default at least, phew. ]
next prev parent reply other threads:[~2015-06-05 14:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-05 11:27 [PATCH] netfilter: bridge: restore vlan tag when refragmenting Florian Westphal
2015-06-05 14:37 ` Eric Dumazet
2015-06-05 14:55 ` Florian Westphal [this message]
2015-06-12 12:31 ` Pablo Neira Ayuso
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=20150605145546.GI11015@breakpoint.cc \
--to=fw@strlen.de \
--cc=eric.dumazet@gmail.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 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.