Commit 0b1eaa88 authored by Stefan Fritsch's avatar Stefan Fritsch Committed by Michael S. Tsirkin
Browse files

virtio-net: Do not filter VLANs without F_CTRL_VLAN



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: default avatarStefan Fritsch <sf@sfritsch.de>
Signed-off-by: default avatarAmos Kong <akong@redhat.com>
Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 53a786ac
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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,