From: David Miller <davem@davemloft.net>
To: florz@florz.de
Cc: kaber@trash.net, eric.dumazet@gmail.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, jpirko@redhat.com
Subject: Re: [PATCH] vlan: don't deliver frames for unknown vlans to protocols
Date: Sun, 07 Oct 2012 00:14:10 -0400 (EDT) [thread overview]
Message-ID: <20121007.001410.1223449597402958747.davem@davemloft.net> (raw)
In-Reply-To: <20121004165020.GT1162@florz.florz.dyndns.org>
From: Florian Zumbiehl <florz@florz.de>
Date: Thu, 4 Oct 2012 18:50:20 +0200
> 6a32e4f9dd9219261f8856f817e6655114cfec2f made the vlan code skip marking
> vlan-tagged frames for not locally configured vlans as PACKET_OTHERHOST if
> there was an rx_handler, as the rx_handler could cause the frame to be received
> on a different (virtual) vlan-capable interface where that vlan might be
> configured.
>
> As rx_handlers do not necessarily return RX_HANDLER_ANOTHER, this could cause
> frames for unknown vlans to be delivered to the protocol stack as if they had
> been received untagged.
>
> For example, if an ipv6 router advertisement that's tagged for a locally not
> configured vlan is received on an interface with macvlan interfaces attached,
> macvlan's rx_handler returns RX_HANDLER_PASS after delivering the frame to the
> macvlan interfaces, which caused it to be passed to the protocol stack, leading
> to ipv6 addresses for the announced prefix being configured even though those
> are completely unusable on the underlying interface.
>
> The fix moves marking as PACKET_OTHERHOST after the rx_handler so the
> rx_handler, if there is one, sees the frame unchanged, but afterwards,
> before the frame is delivered to the protocol stack, it gets marked whether
> there is an rx_handler or not.
>
> Signed-off-by: Florian Zumbiehl <florz@florz.de>
I agree with your analysis but I do not like your fix.
This is one of the hottest paths in the networking stack and I don't
want to add more "pass pointer to local variable" type interfaces.
Fix this in a cleaner way please, thanks
prev parent reply other threads:[~2012-10-07 4:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-04 16:50 [PATCH] vlan: don't deliver frames for unknown vlans to protocols Florian Zumbiehl
2012-10-07 4:14 ` David Miller [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=20121007.001410.1223449597402958747.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=florz@florz.de \
--cc=jpirko@redhat.com \
--cc=kaber@trash.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@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