diff options
author | Cindy Lu <lulu@redhat.com> | 2022-12-14 08:43:06 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2022-12-28 13:28:11 +0300 |
commit | 72455a1142527e607e1d69439f3ffa2ef6d09e26 (patch) | |
tree | 91ecd1304272c14a132c1416f0fe7d0de2302634 /drivers/vdpa/vdpa_sim/vdpa_sim_net.c | |
parent | 0b7a04a30eef20e6b24926a45c0ce7906ae85bd6 (diff) | |
download | linux-72455a1142527e607e1d69439f3ffa2ef6d09e26.tar.xz |
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: 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>
Diffstat (limited to 'drivers/vdpa/vdpa_sim/vdpa_sim_net.c')
-rw-r--r-- | drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c b/drivers/vdpa/vdpa_sim/vdpa_sim_net.c index 11f5a121df24..584b975a98a7 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c +++ b/drivers/vdpa/vdpa_sim/vdpa_sim_net.c @@ -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; |