Skip to content

Commit

Permalink
macvlan: Only update pkt_type if destination MAC address matches
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Duyck authored and David S. Miller committed Oct 15, 2017
1 parent dd6b9c2 commit c8c41ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/macvlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c8c41ea

Please sign in to comment.