]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
net: bridge: reject DSA-enabled master netdevices as bridge members
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 16 Jan 2015 17:56:02 +0000 (09:56 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 19 Jan 2015 20:45:10 +0000 (15:45 -0500)
commit8db0a2ee2c6302a1dcbcdb93cb731dfc6c0cdb5e
tree73b836097d22b1c91acaaa5441180f47756a2658
parent728c02089a0e3eefb02e9927bfae50490f40e72e
net: bridge: reject DSA-enabled master netdevices as bridge members

DSA-enabled master network devices with a switch tagging protocol should
strip the protocol specific format before handing the frame over to
higher layer.

When adding such a DSA master network device as a bridge member, we go
through the following code path when receiving a frame:

__netif_receive_skb_core
-> first ptype check against ptype_all is not returning any
   handler for this skb

-> check and invoke rx_handler:
-> deliver frame to the bridge layer: br_handle_frame

DSA registers a ptype handler with the fake ETH_XDSA ethertype, which is
called *after* the bridge-layer rx_handler has run. br_handle_frame()
tries to parse the frame it received from the DSA master network device,
and will not be able to match any of its conditions and jumps straight
at the end of the end of br_handle_frame() and returns
RX_HANDLER_CONSUMED there.

Since we returned RX_HANDLER_CONSUMED, __netif_receive_skb_core() stops
RX processing for this frame and returns NET_RX_SUCCESS, so we never get
a chance to call our switch tag packet processing logic and deliver
frames to the DSA slave network devices, and so we do not get any
functional bridge members at all.

Instead of cluttering the bridge receive path with DSA-specific checks,
and rely on assumptions about how __netif_receive_skb_core() is
processing frames, we simply deny adding the DSA master network device
(conduit interface) as a bridge member, leaving only the slave DSA
network devices to be bridge members, since those will work correctly in
all circumstances.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_if.c