提交 72455a11 编写于 作者: C Cindy Lu 提交者: Michael S. Tsirkin

vdpa_sim_net: should not drop the multicast/broadcast packet

In the receive_filter(), should not drop the packet with the
broadcast/multicast address. Add the check for this
Signed-off-by: NCindy Lu <lulu@redhat.com>
Message-Id: <20221214054306.24145-1-lulu@redhat.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
Acked-by: NJason Wang <jasowang@redhat.com>
上级 0b7a04a3
...@@ -62,6 +62,9 @@ static bool receive_filter(struct vdpasim *vdpasim, size_t len) ...@@ -62,6 +62,9 @@ static bool receive_filter(struct vdpasim *vdpasim, size_t len)
if (len < ETH_ALEN + hdr_len) if (len < ETH_ALEN + hdr_len)
return false; return false;
if (is_broadcast_ether_addr(vdpasim->buffer + hdr_len) ||
is_multicast_ether_addr(vdpasim->buffer + hdr_len))
return true;
if (!strncmp(vdpasim->buffer + hdr_len, vio_config->mac, ETH_ALEN)) if (!strncmp(vdpasim->buffer + hdr_len, vio_config->mac, ETH_ALEN))
return true; return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册