aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksandr Fedorov <afedorov@FreeBSD.org>2022-02-05 15:47:46 +0000
committerAleksandr Fedorov <afedorov@FreeBSD.org>2022-02-05 15:47:46 +0000
commitfc035df8af32d496885e5da26e519ce6a262c9bf (patch)
tree7a50a6bfedbdb872e4ac741492d6078ce2e1aab7
parentf7220c486c1bf858e97c2d8e5c4c9dac4947d50a (diff)
downloadsrc-fc035df8af32d496885e5da26e519ce6a262c9bf.tar.gz
src-fc035df8af32d496885e5da26e519ce6a262c9bf.zip
if_vtnet(4): Restore the ability to set promisc mode.
PR: 254343, 255054 Reviewed by: vmaffione (mentor), donner Approved by: vmaffione (mentor), donner MFC after: 2 weeks Sponsored by: vstack.com Differential Revision: https://reviews.freebsd.org/D30639
-rw-r--r--sys/dev/virtio/network/if_vtnet.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c
index 7cbbe56e6c6b..0a020e6b6c91 100644
--- a/sys/dev/virtio/network/if_vtnet.c
+++ b/sys/dev/virtio/network/if_vtnet.c
@@ -1302,9 +1302,13 @@ vtnet_ioctl_ifflags(struct vtnet_softc *sc)
if ((ifp->if_flags ^ sc->vtnet_if_flags) &
(IFF_PROMISC | IFF_ALLMULTI)) {
- if ((sc->vtnet_flags & VTNET_FLAG_CTRL_RX) == 0)
- return (ENOTSUP);
- vtnet_rx_filter(sc);
+ if (sc->vtnet_flags & VTNET_FLAG_CTRL_RX)
+ vtnet_rx_filter(sc);
+ else {
+ if ((ifp->if_flags ^ sc->vtnet_if_flags) & IFF_ALLMULTI)
+ return (ENOTSUP);
+ ifp->if_flags |= IFF_PROMISC;
+ }
}
out: