Skip to content

Commit 6a9e461

Browse files
Mahesh Bandewardavem330
Mahesh Bandewar
authored andcommitted
bonding: pass link-local packets to bonding master also.
Commit b89f04c ("bonding: deliver link-local packets with skb->dev set to link that packets arrived on") changed the behavior of how link-local-multicast packets are processed. The change in the behavior broke some legacy use cases where these packets are expected to arrive on bonding master device also. This patch passes the packet to the stack with the link it arrived on as well as passes to the bonding-master device to preserve the legacy use case. Fixes: b89f04c ("bonding: deliver link-local packets with skb->dev set to link that packets arrived on") Reported-by: Michal Soltys <[email protected]> Signed-off-by: Mahesh Bandewar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d3a3157 commit 6a9e461

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

drivers/net/bonding/bond_main.c

+19-2
Original file line numberDiff line numberDiff line change
@@ -1170,9 +1170,26 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
11701170
}
11711171
}
11721172

1173-
/* don't change skb->dev for link-local packets */
1174-
if (is_link_local_ether_addr(eth_hdr(skb)->h_dest))
1173+
/* Link-local multicast packets should be passed to the
1174+
* stack on the link they arrive as well as pass them to the
1175+
* bond-master device. These packets are mostly usable when
1176+
* stack receives it with the link on which they arrive
1177+
* (e.g. LLDP) they also must be available on master. Some of
1178+
* the use cases include (but are not limited to): LLDP agents
1179+
* that must be able to operate both on enslaved interfaces as
1180+
* well as on bonds themselves; linux bridges that must be able
1181+
* to process/pass BPDUs from attached bonds when any kind of
1182+
* STP version is enabled on the network.
1183+
*/
1184+
if (is_link_local_ether_addr(eth_hdr(skb)->h_dest)) {
1185+
struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
1186+
1187+
if (nskb) {
1188+
nskb->dev = bond->dev;
1189+
netif_rx(nskb);
1190+
}
11751191
return RX_HANDLER_PASS;
1192+
}
11761193
if (bond_should_deliver_exact_match(skb, slave, bond))
11771194
return RX_HANDLER_EXACT;
11781195

0 commit comments

Comments
 (0)