aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-10-14 18:46:36 -0700
committerDavid S. Miller <davem@davemloft.net>2017-10-14 18:46:36 -0700
commit6eda447e01bdc992c8b1e081ebadc255e7549e13 (patch)
tree27d6dacd64d59e8339ac58feca9ba929e7ebaeb6
parenttcp: add a tracepoint for tcp retransmission (diff)
parentmacvlan: Only update pkt_type if destination MAC address matches (diff)
downloadlinux-dev-6eda447e01bdc992c8b1e081ebadc255e7549e13.tar.xz
linux-dev-6eda447e01bdc992c8b1e081ebadc255e7549e13.zip
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: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/macvlan.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 858bd66511a2..1e1df54c5d31 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -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);
@@ -480,7 +482,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;