qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL for-2.0 3/4] virtio-net: Do not filter VLANs without


From: Michael S. Tsirkin
Subject: [Qemu-devel] [PULL for-2.0 3/4] virtio-net: Do not filter VLANs without F_CTRL_VLAN
Date: Wed, 26 Mar 2014 14:23:18 +0200

From: Stefan Fritsch <address@hidden>

If VIRTIO_NET_F_CTRL_VLAN is not negotiated, do not filter out all
VLAN-tagged packets but send them to the guest.

This fixes VLANs with OpenBSD guests (and probably NetBSD, too, because
the OpenBSD driver started as a port from NetBSD).

Signed-off-by: Stefan Fritsch <address@hidden>
Signed-off-by: Amos Kong <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
 hw/net/virtio-net.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index fd23c46..33fb799 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -514,6 +514,12 @@ static void virtio_net_set_features(VirtIODevice *vdev, 
uint32_t features)
         }
         vhost_net_ack_features(tap_get_vhost_net(nc->peer), features);
     }
+
+    if ((1 << VIRTIO_NET_F_CTRL_VLAN) & features) {
+        memset(n->vlans, 0, MAX_VLAN >> 3);
+    } else {
+        memset(n->vlans, 0xff, MAX_VLAN >> 3);
+    }
 }
 
 static int virtio_net_handle_rx_mode(VirtIONet *n, uint8_t cmd,
-- 
MST




reply via email to

[Prev in Thread] Current Thread [Next in Thread]