diff mbox series

[1/3] virtio-net: do not reset vlan filtering at set_features

Message ID 20220906163621.1144675-2-eperezma@redhat.com (mailing list archive)
State New, archived
Headers show
Series Vhost-vdpa Shadow Virtqueue VLAN support | expand

Commit Message

Eugenio Perez Martin Sept. 6, 2022, 4:36 p.m. UTC
This function is called after virtio_load, so all vlan configuration is
lost in migration case.

Just allow all the vlan-tagged packets if vlan is not configured, and
trust device reset to clear all filtered vlans.

Fixes: 0b1eaa8803 ("virtio-net: Do not filter VLANs without F_CTRL_VLAN")
Signed-off-by: Eugenio PĂ©rez <eperezma@redhat.com>
---
 hw/net/virtio-net.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 63a8332cd0..c1bea3fd42 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -920,9 +920,7 @@  static void virtio_net_set_features(VirtIODevice *vdev, uint64_t features)
         vhost_net_ack_features(get_vhost_net(nc->peer), features);
     }
 
-    if (virtio_has_feature(features, VIRTIO_NET_F_CTRL_VLAN)) {
-        memset(n->vlans, 0, MAX_VLAN >> 3);
-    } else {
+    if (!virtio_has_feature(features, VIRTIO_NET_F_CTRL_VLAN)) {
         memset(n->vlans, 0xff, MAX_VLAN >> 3);
     }