Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937634AbdLRRum (ORCPT ); Mon, 18 Dec 2017 12:50:42 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:36204 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934485AbdLRP5R (ORCPT ); Mon, 18 Dec 2017 10:57:17 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Duyck , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 112/115] macvlan: Only deliver one copy of the frame to the macvlan interface Date: Mon, 18 Dec 2017 16:49:41 +0100 Message-Id: <20171218152900.649086020@linuxfoundation.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171218152851.886086917@linuxfoundation.org> References: <20171218152851.886086917@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1478 Lines: 40 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alexander Duyck [ 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 Signed-off-by: Greg Kroah-Hartman --- drivers/net/macvlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -441,7 +441,7 @@ static rx_handler_result_t macvlan_handl struct macvlan_dev, list); else vlan = macvlan_hash_lookup(port, eth->h_dest); - if (vlan == NULL) + if (!vlan || vlan->mode == MACVLAN_MODE_SOURCE) return RX_HANDLER_PASS; dev = vlan->dev;