Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Feb 2022 11:09:37 GMT
From:      Aleksandr Fedorov <afedorov@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 009a56b2e416 - stable/13 - if_vtnet(4): Restore the ability to set promisc mode.
Message-ID:  <202202231109.21NB9bCs052735@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by afedorov:

URL: https://cgit.FreeBSD.org/src/commit/?id=009a56b2e416cf32b28be405876ab38bd7544d98

commit 009a56b2e416cf32b28be405876ab38bd7544d98
Author:     Aleksandr Fedorov <afedorov@FreeBSD.org>
AuthorDate: 2022-02-05 15:47:46 +0000
Commit:     Aleksandr Fedorov <afedorov@FreeBSD.org>
CommitDate: 2022-02-23 11:08:24 +0000

    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
    
    (cherry picked from commit fc035df8af32d496885e5da26e519ce6a262c9bf)
---
 sys/dev/virtio/network/if_vtnet.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c
index 3650d19fbe0e..2b25fbfb6b93 100644
--- a/sys/dev/virtio/network/if_vtnet.c
+++ b/sys/dev/virtio/network/if_vtnet.c
@@ -1296,9 +1296,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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202202231109.21NB9bCs052735>