From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mahesh Bandewar Subject: [PATCH net v2] bonding: pass link-local packets to bonding master also. Date: Wed, 18 Jul 2018 16:41:06 -0700 Message-ID: <20180718234106.243196-1-mahesh@bandewar.net> Cc: Netdev , Michal Soltys , Mahesh Bandewar , Mahesh Bandewar To: Jay Vosburgh , Andy Gospodarek , Veaceslav Falico , David Miller Return-path: Received: from mail-pf0-f195.google.com ([209.85.192.195]:45173 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728304AbeGSAV1 (ORCPT ); Wed, 18 Jul 2018 20:21:27 -0400 Received: by mail-pf0-f195.google.com with SMTP id i26-v6so2923547pfo.12 for ; Wed, 18 Jul 2018 16:41:11 -0700 (PDT) Sender: netdev-owner@vger.kernel.org List-ID: From: Mahesh Bandewar Commit b89f04c61efe ("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: b89f04c61efe ("bonding: deliver link-local packets with skb->dev set to link that packets arrived on") Reported-by: Michal Soltys Signed-off-by: Mahesh Bandewar --- v2: Added Fixes tag. v1: Initial patch. drivers/net/bonding/bond_main.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 9a2ea3c1f949..1d3b7d8448f2 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1177,9 +1177,22 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb) } } - /* don't change skb->dev for link-local packets */ - if (is_link_local_ether_addr(eth_hdr(skb)->h_dest)) + /* Link-local multicast packets should be passed to the + * stack on the link they arrive as well as pass them to the + * bond-master device. These packets are mostly usable when + * stack receives it with the link on which they arrive + * (e.g. LLDP) but there may be some legacy behavior that + * expects these packets to appear on bonding master too. + */ + if (is_link_local_ether_addr(eth_hdr(skb)->h_dest)) { + struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC); + + if (nskb) { + nskb->dev = bond->dev; + netif_rx(nskb); + } return RX_HANDLER_PASS; + } if (bond_should_deliver_exact_match(skb, slave, bond)) return RX_HANDLER_EXACT; -- 2.18.0.203.gfac676dfb9-goog