Return-Path: Received: from mail-sn1nam01on0102.outbound.protection.outlook.com ([104.47.32.102]:28096 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932696AbeARVHL (ORCPT ); Thu, 18 Jan 2018 16:07:11 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Alexander Duyck , "David S . Miller" , Sasha Levin Subject: [added to the 4.1 stable tree] macvlan: Only deliver one copy of the frame to the macvlan interface Date: Thu, 18 Jan 2018 21:01:57 +0000 Message-ID: <20180118205908.3220-286-alexander.levin@microsoft.com> References: <20180118205908.3220-1-alexander.levin@microsoft.com> In-Reply-To: <20180118205908.3220-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Alexander Duyck This patch has been added to the stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit dd6b9c2c332b40f142740d1b11fb77c653ff98ea ] This patch intoduces a slight adjustment for macvlan to address the fact that in source mode I was seeing two copies of any packet addressed to the macvlan interface being delivered where there should have been only one. The issue appears to be that one copy was delivered based on the source MAC address and then the second copy was being delivered based on the destination MAC address. To fix it I am just treating a unicast address match as though it is not a match since source based macvlan isn't supposed to be matching based on the destination MAC anyway. Fixes: 79cf79abce71 ("macvlan: add source mode") Signed-off-by: Alexander Duyck Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/macvlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 9f59f17dc317..e10cff854b24 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -440,7 +440,7 @@ static rx_handler_result_t macvlan_handle_frame(struct = sk_buff **pskb) struct macvlan_dev, list); else vlan =3D macvlan_hash_lookup(port, eth->h_dest); - if (vlan =3D=3D NULL) + if (!vlan || vlan->mode =3D=3D MACVLAN_MODE_SOURCE) return RX_HANDLER_PASS; =20 dev =3D vlan->dev; --=20 2.11.0