From patchwork Wed Jul 18 19:55: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: 945887 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="FNTXCndF"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41W7Dr1ZSJz9s21 for ; Thu, 19 Jul 2018 05:55:56 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730524AbeGRUfT (ORCPT ); Wed, 18 Jul 2018 16:35:19 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:39076 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726955AbeGRUfT (ORCPT ); Wed, 18 Jul 2018 16:35:19 -0400 Received: by mail-pf0-f193.google.com with SMTP id j8-v6so2693951pff.6 for ; Wed, 18 Jul 2018 12:55:53 -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; bh=401KfDTQwxLjL4foIKI/pgv08+GE2eOYlyT0EeoGd/Y=; b=FNTXCndFcZQJtImxjYYpUVSiHsAJNZHwI9zRMzHpUGynBVnf8NHpeP52hHe9QPM3d1 yUZdHfgL33ortehrIeSwvJZ0zyk7lXTp2LZrqGqXEhaUmumWsNFkQzGQeoMbnJreQ4HH psTT8NtVrPYM/v76BPn9311uwmvPUeIgJPHftRvhLWNlUP/AiYi4J1SF4WiydiurKW7x /2NopzAacj2/YtK3FhFXmdIJzgRImNNcMdI6RINwG6V4JPeGtB5bnXoY5GHuVx61dxX1 BVEFEbgav+krzi7AZyJyE6FFHjR91Mr1MhLzheW30pyWhzyzNyQnjzqoXK4dDgm27Wsw 21/A== 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; bh=401KfDTQwxLjL4foIKI/pgv08+GE2eOYlyT0EeoGd/Y=; b=e7Af1Pqmum8si9lPROtSqwkgJV40/152sYsqmLj5ww4l1kP6lKw8qUMY0kvVpppP4n gUPKl0CRS5GXGiujAuX/VmR2SEd2FDEMiLrV4nl2ZZ83DL2RajI7McmtHbLu9SNGEEN4 26ig1JzAZYGd9m+tBrxASEyN5fpEqyIzoWuEpE4M3pLwmS1IDRF8IJYSGx5kOn3IV8Qd tn30pYcO6/NuUXyDHeuEIp4BVhpDpd/smHqg4NDN+s4QmDP3imiwQbSmwOXalDiO0UCG kWJiZGVkdX74+UVUN6kl+9p8mA9PoRSrhavnwq2TWyzXlqNm6VKlvirpUPuuuvWnxK4v aVxg== X-Gm-Message-State: AOUpUlFAE7pIgpuDB41Gx92oyDNbTAky8PvvEsYCMT6U4apDtuliAE5f QD2xSy9hIE1MqSv93A47lNI9Rw== X-Google-Smtp-Source: AAOMgpfCk4jJOkW1DX65VumDADIcaKCbFzYXjwg5zOPIrYvE+0m2SJ6TtWNuo2jxZ1B8EwfyXSEIeQ== X-Received: by 2002:a63:d916:: with SMTP id r22-v6mr6904185pgg.381.1531943753418; Wed, 18 Jul 2018 12:55:53 -0700 (PDT) Received: from localhost ([2620:15c:2c4:201:c7f9:6225:a527:f3a4]) by smtp.gmail.com with ESMTPSA id z123-v6sm6007391pfz.16.2018.07.18.12.55.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Jul 2018 12:55:52 -0700 (PDT) From: Mahesh Bandewar To: Jay Vosburgh , Andy Gospodarek , Veaceslav Falico , David Miller Cc: Netdev , Michal Soltys , Mahesh Bandewar , Mahesh Bandewar Subject: [PATCH next v2] bonding: pass link-local packets to bonding master also. Date: Wed, 18 Jul 2018 12:55:42 -0700 Message-Id: <20180718195542.191981-1-mahesh@bandewar.net> X-Mailer: git-send-email 2.18.0.203.gfac676dfb9-goog 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 --- 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;