Skip to content

Commit

Permalink
vdpa_sim_net: should not drop the multicast/broadcast packet
Browse files Browse the repository at this point in the history
[ Upstream commit 72455a1 ]

In the receive_filter(), should not drop the packet with the
broadcast/multicast address. Add the check for this

Signed-off-by: Cindy Lu <lulu@redhat.com>
Message-Id: <20221214054306.24145-1-lulu@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
lulu-github-name authored and gregkh committed Jan 24, 2023
1 parent c6c6af9 commit 11891c8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/vdpa/vdpa_sim/vdpa_sim_net.c
Expand Up @@ -62,6 +62,9 @@ static bool receive_filter(struct vdpasim *vdpasim, size_t len)
if (len < ETH_ALEN + hdr_len)
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))
return true;

Expand Down

0 comments on commit 11891c8

Please sign in to comment.