From patchwork Mon Sep 24 21:39:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mahesh Bandewar X-Patchwork-Id: 974094 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bandewar.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=bandewar-net.20150623.gappssmtp.com header.i=@bandewar-net.20150623.gappssmtp.com header.b="P0QINe2a"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42JyKJ66fHz9s7T for ; Tue, 25 Sep 2018 07:39:48 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728374AbeIYDoB (ORCPT ); Mon, 24 Sep 2018 23:44:01 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:35978 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726526AbeIYDoA (ORCPT ); Mon, 24 Sep 2018 23:44:00 -0400 Received: by mail-pf1-f193.google.com with SMTP id b7-v6so2273826pfo.3 for ; Mon, 24 Sep 2018 14:39:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bandewar-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BYNUw6C1tM8qeXUFxr3A2JSgnTDMsiO7etHUMXRRnF0=; b=P0QINe2ay3pDW5ugw96pPnFwCbmufUcQx9Csc8W1sh/cAD8vK8EeQr3H+sVBULHmrc Mlfn0W9XlPbW+h2wf4Z8gkVRyDfCpmrYsaQA0d7qZCV+pMn5zEotzO9lIOhmtJ0lAv9e vnohroio1cHzvpH6j4/0xl5WV6lpNP4yD62GYczrHWTXT5e//E+UsAmr6Le45Ylo0erA pZGJ7qePeWOUA0KIxqzwDy8FH2zBjBkgQ9v2CK4frDCnkEzJfsDvJQZ2e3x5R1cHcsxo 7MjVCJxlEXUlp21ZmbYKwUPBAYSeJFjSVUhNw991Y0GSdBB6sjwnpz3vRqwNCo3ecvyD KIKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BYNUw6C1tM8qeXUFxr3A2JSgnTDMsiO7etHUMXRRnF0=; b=NeV7Ekr8D19d22Sbj47kfbnF+jHJuiKP3vywRByAXm3UyaglOL+XcP3edEwzThB3Z7 rBWyWf2UtH1FrBOnGoYsDQiCwjY5O1K+u/rAklKzCi5bAfcL48IP9nUN7P0nZLs75yPS mQH/Wq06Mzl3mSoS2SSaImt+n+FOEKXpXVRdW50fpEYarif84G9ZtItPnlGBbKquW+Mc rB6eTpvCER7oAqbKE6xwEExOu0rgP1f5hLkNuPzi55Jkp9AZda/VahslJRNWOXTk1AD9 JqwxolmdkV+d5G1IhvTIsBWecQsSo2Y/1+tZhIbqEqP7XGs+ayt1bpvZBkpzdUJwxyLv SLCQ== X-Gm-Message-State: ABuFfog8oNdU0qrL5l/A/oJLocgXqd14gW5OXUwHKgFdvCy9cmMAoOlk dl77Ktmg5x7rWYD6CnCKJ0Zg0nrDLpw= X-Google-Smtp-Source: ACcGV635iNupfc04M3TRb6RjQqcp+H1dRAX/Qt0lG2LzDhc0mZW8ciCRdRCJx/w1jWjSw2SjUIJzDg== X-Received: by 2002:a63:906:: with SMTP id 6-v6mr565667pgj.92.1537825186580; Mon, 24 Sep 2018 14:39:46 -0700 (PDT) Received: from localhost ([2620:15c:2c4:201:c7f9:6225:a527:f3a4]) by smtp.gmail.com with ESMTPSA id h130-v6sm278801pgc.88.2018.09.24.14.39.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Sep 2018 14:39:46 -0700 (PDT) From: Mahesh Bandewar To: Jay Vosburgh , Andy Gospodarek , Veaceslav Falico , David Miller Cc: Mahesh Bandewar , Netdev , Eric Dumazet , Mahesh Bandewar Subject: [PATCH net] bonding: pass link-local packets to bonding master also. Date: Mon, 24 Sep 2018 14:39:42 -0700 Message-Id: <20180924213942.234209-1-mahesh@bandewar.net> X-Mailer: git-send-email 2.19.0.444.g18242da7ef-goog MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- drivers/net/bonding/bond_main.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 9866fa959a19..e3157aed656a 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1178,9 +1178,26 @@ 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) they also must be available on master. Some of + * the use cases include (but are not limited to): LLDP agents + * that must be able to operate both on enslaved interfaces as + * well as on bonds themselves; linux bridges that must be able + * to process/pass BPDUs from attached bonds when any kind of + * STP version is enabled on the network. + */ + 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;