提交 0d6b425a 编写于 作者: K Kejian Yan 提交者: David S. Miller

net: hns: bug fix about ping6

The current upstreaming code fails to ping other IPv6 net device, because
the enet receives the multicast packets with the src mac addr which is the
same as its mac addr. These packets need to be dropped.
Signed-off-by: NKejian Yan <yankejian@huawei.com>
Signed-off-by: NYisen Zhuang <Yisen.Zhuang@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 db219baf
...@@ -564,6 +564,7 @@ static int hns_nic_poll_rx_skb(struct hns_nic_ring_data *ring_data, ...@@ -564,6 +564,7 @@ static int hns_nic_poll_rx_skb(struct hns_nic_ring_data *ring_data,
struct sk_buff *skb; struct sk_buff *skb;
struct hnae_desc *desc; struct hnae_desc *desc;
struct hnae_desc_cb *desc_cb; struct hnae_desc_cb *desc_cb;
struct ethhdr *eh;
unsigned char *va; unsigned char *va;
int bnum, length, i; int bnum, length, i;
int pull_len; int pull_len;
...@@ -670,6 +671,14 @@ static int hns_nic_poll_rx_skb(struct hns_nic_ring_data *ring_data, ...@@ -670,6 +671,14 @@ static int hns_nic_poll_rx_skb(struct hns_nic_ring_data *ring_data,
return -EFAULT; return -EFAULT;
} }
/* filter out multicast pkt with the same src mac as this port */
eh = eth_hdr(skb);
if (unlikely(is_multicast_ether_addr(eh->h_dest) &&
ether_addr_equal(ndev->dev_addr, eh->h_source))) {
dev_kfree_skb_any(skb);
return -EFAULT;
}
ring->stats.rx_pkts++; ring->stats.rx_pkts++;
ring->stats.rx_bytes += skb->len; ring->stats.rx_bytes += skb->len;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册