]> git.baikalelectronics.ru Git - kernel.git/commit
bonding: fix PACKET_ORIGDEV regression
authorMichal Soltys <soltys@ziu.info>
Mon, 18 Feb 2019 16:55:28 +0000 (17:55 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Feb 2019 21:20:08 +0000 (13:20 -0800)
commit855c2b6cdbb382849530dd4a2257e2996a75c717
tree927949fa4c30a79e15f9ed9c8db91a9054bcb6e3
parentd1f9a1135294a4472240359f2ae1b7784bf5b007
bonding: fix PACKET_ORIGDEV regression

This patch fixes a subtle PACKET_ORIGDEV regression which was a side
effect of fixes introduced by:

6ec689095f2a bonding: pass link-local packets to bonding master also.

... to:

30fb622e8ace bonding: deliver link-local packets with skb->dev set to link that packets arrived on

While 6ec689095f2a restored pre-30fb622e8ace presence of link-local
packets on bonding masters (which is required e.g. by linux bridges
participating in spanning tree or needed for lab-like setups created
with group_fwd_mask) it also caused the originating device
information to be lost due to cloning.

Maciej Żenczykowski proposed another solution that doesn't require
packet cloning and retains original device information - instead of
returning RX_HANDLER_PASS for all link-local packets it's now limited
only to packets from inactive slaves.

At the same time, packets passed to bonding masters retain correct
information about the originating device and PACKET_ORIGDEV can be used
to determine it.

This elegantly solves all issues so far:

- link-local packets that were removed from bonding masters
- LLDP daemons being forced to explicitly bind to slave interfaces
- PACKET_ORIGDEV having no effect on bond interfaces

Fixes: 6ec689095f2a (bonding: pass link-local packets to bonding master also.)
Reported-by: Vincent Bernat <vincent@bernat.ch>
Signed-off-by: Michal Soltys <soltys@ziu.info>
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c