Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5439750imm; Tue, 16 Oct 2018 10:14:50 -0700 (PDT) X-Google-Smtp-Source: ACcGV60445nDQXowo3bmmNX6sFVhW8pk/NDhB+8FhFroc6pMIXGRj8vYpVlIdZGIs9tueFMLDfot X-Received: by 2002:a63:1b61:: with SMTP id b33-v6mr21085382pgm.245.1539710090604; Tue, 16 Oct 2018 10:14:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539710090; cv=none; d=google.com; s=arc-20160816; b=fKncRUeXAqvVghbz4Xve6QqWS/v6hdCKkyjtSEorjgIfX4VY8+e9cJdKNdsYLkhdMc iEm6bEGMCNaiqdDd0DZM6twuHAGUuKNaTXqdtAYVL778xwgZ5vcF0tyERGU8uYvHeJSb 4Q2PN1/q8LHXRI8VkMrgUaKg0lqr44vqTvmijgBNthAB8x42RW3uOVEbxipxoEvDwuOU IG1gzQmTt8Uck6QYruXSZFzV2ii221TqhCx8qeH1ikS3EBu81ge2cJFQUz8PHpkch5l2 dCBNIXNAn5gl60kdN1Xm7vqYmdeJFMaEDp1AmuH9u+vnmKIKPw+gjqaUdelf5xQqM0CM wx3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HEZiNjPOqeR+Va1w+jjH20NdNbKpKrH+xfagB4LOK8Q=; b=oA7KZAxu6vOuhKiautXxh+5atRc4SPn9A/6OWqVkND81pFIbobZBIySHCZlr8U0cJu 4HkzZDwaEEFauPdZzVspJriagI/GV1o/Lfc3Fn6MecLaASgVMCnVTgv6ry7oheM4XBVM H8N50Y3mrD57Dzr9hNXn8NaSQH2/0CTC0HOYBhxbWj3ZDK4HEvr1OExWzjK0uYPZ/E+t 1bCwKDaGvf29ANsoy7riF9AL+aj/7UcmiToVtT9U0WCm568A4GUWwLe/nR1UXTVS/jvs j5l1Imv4p1bilW91eNBjcQOsP8jhIETE5ErZSqUC5hlLxKIMn46C1O9DJmE9F1d05n0u /VzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LAmlxPPo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h91-v6si3854221pld.81.2018.10.16.10.14.34; Tue, 16 Oct 2018 10:14:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LAmlxPPo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728489AbeJQBDh (ORCPT + 99 others); Tue, 16 Oct 2018 21:03:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:45720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727263AbeJQBDg (ORCPT ); Tue, 16 Oct 2018 21:03:36 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8748A20866; Tue, 16 Oct 2018 17:12:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539709934; bh=3ORUG0ozdIxf3cK5JBYwXuGwocc+dxDHawtIpCeFt5I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LAmlxPPop+X/xQTpHeqUFIf9coJe4+F20Hyp9ChEUO0QY1CKgx6tMQiJg5itpM6T8 rbGJEQSfnVDhLs4TZV/BK0Yn/vyLQOe3kD5FJY67m6HMxWXxfALUivB7PdXfQz1xXr zW5kv40YQlZPrH7dnWKHBMYMNJoK0fEQUjWCcHx8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michal Soltys , Mahesh Bandewar , "David S. Miller" Subject: [PATCH 4.18 039/135] bonding: pass link-local packets to bonding master also. Date: Tue, 16 Oct 2018 19:04:29 +0200 Message-Id: <20181016170517.590028583@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181016170515.447235311@linuxfoundation.org> References: <20181016170515.447235311@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mahesh Bandewar [ Upstream commit 6a9e461f6fe4434e6172304b69774daff9a3ac4c ] 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/bonding/bond_main.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) --- 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_f } } - /* 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;