vdpa_sim_net: should not drop the multicast/broadcast packet
authorCindy Lu <lulu@redhat.com>
Wed, 14 Dec 2022 05:43:06 +0000 (13:43 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 28 Dec 2022 10:28:11 +0000 (05:28 -0500)
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>
drivers/vdpa/vdpa_sim/vdpa_sim_net.c

index 11f5a121df243f782482422a7e8c691dd504c9a5..584b975a98a7ef3c8e05e0411292f546b536ec81 100644 (file)
@@ -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;