]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
macvlan: Only update pkt_type if destination MAC address matches
authorAlexander Duyck <alexander.h.duyck@intel.com>
Fri, 13 Oct 2017 20:40:31 +0000 (13:40 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 15 Oct 2017 01:46:36 +0000 (18:46 -0700)
This patch updates the pkt_type to PACKET_HOST only if the destination MAC
address matches on the on the source based macvlan. It didn't make sense to
be updating broadcast, multicast, and non-local destined frames with
PACKET_HOST.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macvlan.c

index a4ae8cd0f6606cbf032980b2d65e543453c101f8..1e1df54c5d3179940c0ea5b390a3e6e68d9dfbe9 100644 (file)
@@ -413,7 +413,9 @@ static void macvlan_forward_source_one(struct sk_buff *skb,
 
        len = nskb->len + ETH_HLEN;
        nskb->dev = dev;
-       nskb->pkt_type = PACKET_HOST;
+
+       if (ether_addr_equal_64bits(eth_hdr(skb)->h_dest, dev->dev_addr))
+               nskb->pkt_type = PACKET_HOST;
 
        ret = netif_rx(nskb);
        macvlan_count_rx(vlan, len, ret == NET_RX_SUCCESS, false);