]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
macvlan: Only deliver one copy of the frame to the macvlan interface
authorAlexander Duyck <alexander.h.duyck@intel.com>
Fri, 13 Oct 2017 20:40:24 +0000 (13:40 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 15 Oct 2017 01:46:36 +0000 (18:46 -0700)
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 <alexander.h.duyck@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macvlan.c

index 858bd66511a270f70a675d6cf4651b512ddc9352..a4ae8cd0f6606cbf032980b2d65e543453c101f8 100644 (file)
@@ -480,7 +480,7 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb)
                                              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;