Commit 6eda447e authored by David S. Miller's avatar David S. Miller

Merge branch 'macvlan-cleanups'

Alexander Duyck says:

====================
net: Minor macvlan source mode cleanups

So this patch series is just a few minor cleanups for macvlan source mode.
The first patch addresses double receives when a packet is being routed to
the macvlan destination address, and the other addresses the pkt_type being
updated in cases where it most likely should not be.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents e086101b c8c41ea1
...@@ -413,7 +413,9 @@ static void macvlan_forward_source_one(struct sk_buff *skb, ...@@ -413,7 +413,9 @@ static void macvlan_forward_source_one(struct sk_buff *skb,
len = nskb->len + ETH_HLEN; len = nskb->len + ETH_HLEN;
nskb->dev = dev; 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); ret = netif_rx(nskb);
macvlan_count_rx(vlan, len, ret == NET_RX_SUCCESS, false); macvlan_count_rx(vlan, len, ret == NET_RX_SUCCESS, false);
...@@ -480,7 +482,7 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb) ...@@ -480,7 +482,7 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb)
struct macvlan_dev, list); struct macvlan_dev, list);
else else
vlan = macvlan_hash_lookup(port, eth->h_dest); vlan = macvlan_hash_lookup(port, eth->h_dest);
if (vlan == NULL) if (!vlan || vlan->mode == MACVLAN_MODE_SOURCE)
return RX_HANDLER_PASS; return RX_HANDLER_PASS;
dev = vlan->dev; dev = vlan->dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment