diff options
author | Stefan Fritsch <sf@cvs.openbsd.org> | 2014-06-17 19:46:14 +0000 |
---|---|---|
committer | Stefan Fritsch <sf@cvs.openbsd.org> | 2014-06-17 19:46:14 +0000 |
commit | f4c68172f3b2828addbb88ac963fa0fb50ebd5d2 (patch) | |
tree | f12d89b49fd79c97216d4410b93f90cf20b9aae7 /sys/dev/pci | |
parent | 77ca4df22e358968cafd9df95d888acd06baff12 (diff) |
Add a configurable workaround for a bug in qemu < 2.0 that prevented VLANs
from working.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_vio.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/dev/pci/if_vio.c b/sys/dev/pci/if_vio.c index cd6d419b834..3621489679b 100644 --- a/sys/dev/pci/if_vio.c +++ b/sys/dev/pci/if_vio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vio.c,v 1.15 2014/01/19 20:49:02 bluhm Exp $ */ +/* $OpenBSD: if_vio.c,v 1.16 2014/06/17 19:46:13 sf Exp $ */ /* * Copyright (c) 2012 Stefan Fritsch, Alexander Fiveg. @@ -91,6 +91,13 @@ #define VIRTIO_NET_F_CTRL_RX_EXTRA (1<<20) #define VIRTIO_NET_F_GUEST_ANNOUNCE (1<<21) +/* + * Config(8) flags. The lowest byte is reserved for generic virtio stuff. + */ + +/* Workaround for vlan related bug in qemu < version 2.0 */ +#define CONFFLAG_QEMU_VLAN_BUG (1<<8) + static const struct virtio_feature_name virtio_net_feature_names[] = { { VIRTIO_NET_F_CSUM, "CSum" }, { VIRTIO_NET_F_GUEST_CSUM, "GuestCSum" }, @@ -1395,6 +1402,9 @@ vio_iff(struct vio_softc *sc) return; } + if (sc->sc_dev.dv_cfdata->cf_flags & CONFFLAG_QEMU_VLAN_BUG) + ifp->if_flags |= IFF_PROMISC; + if (ifp->if_flags & IFF_PROMISC || ac->ac_multirangecnt > 0 || ac->ac_multicnt >= VIRTIO_NET_CTRL_MAC_MC_ENTRIES) { ifp->if_flags |= IFF_ALLMULTI; |