From nobody Wed Feb 23 11:09:37 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2B53C19DF3D4; Wed, 23 Feb 2022 11:09:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K3YGB0mxYz4t9x; Wed, 23 Feb 2022 11:09:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645614578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8EX2MKvJbv6JQ/nhShUC/Qajsvgyw3ajKLp7Z6Y2vuk=; b=DAYz69OjCH/xoz99rZspzbfac4cBNpuNEObueN1EBkTotwF1PhBmweuEenCsNXBAEf9ra5 CiPwjmOAIg8K0Ll2oXiGQEGbHSIP+UEI0Rssg7q/jVpq6YlWfetOLbdK33Zq5s3w7eI+UM zb1+h2mzUpA0EerI3L3OOw9EJIfCfhN1coWKsk+19dPxIxMLCY4qdi7CDocYZF7cWFNAXJ cYAcjg+AS0plCe+3j1t958yAZgdWqKu3XCf/KNOdd8UG1wBAURP4iCd9h3SkiiQz0nO0kQ cLWvom4eYKbtoONoo4TULX+/WxuumWoJynIO1zYWZXGAsv4GXuE7zMOTg1OV6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF77A17134; Wed, 23 Feb 2022 11:09:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21NB9bdJ052736; Wed, 23 Feb 2022 11:09:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21NB9bCs052735; Wed, 23 Feb 2022 11:09:37 GMT (envelope-from git) Date: Wed, 23 Feb 2022 11:09:37 GMT Message-Id: <202202231109.21NB9bCs052735@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Aleksandr Fedorov Subject: git: 009a56b2e416 - stable/13 - if_vtnet(4): Restore the ability to set promisc mode. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: afedorov X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 009a56b2e416cf32b28be405876ab38bd7544d98 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645614578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8EX2MKvJbv6JQ/nhShUC/Qajsvgyw3ajKLp7Z6Y2vuk=; b=aZjGjK7F0UHMKYfvrme49ovMwyoFtgdPPR5O7gfr07IDI9StQxTlwttONNti4GBPm1Li1d W69vmmCvmTCUNN8b/zjHfrN/Qr/2Rleb+Jg+SEbCpY5zz4HfiTF34hjtG5RRFybKXpI8YK 3pX8Z5gNOmM/m6pEX0MeKQYfCyfEELhAiOfAOeHOQZsGBCyj9rBRnxTzoEdwH02euSQ6B7 ssGycC82qOY6BnpUHT1RC7+7wi0F1QNvNW72UntHaha3D499wp1AU04qr9McGimAVJG33K 2v2VXCf5Nn3sbcwagJnTzrFbP45JcDDNxjM+ja5MnQ4XZS6Dgci59uIuLwE6AA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645614578; a=rsa-sha256; cv=none; b=j42utQ5CZBqSoG9ono7f4f4Cq/LoMKOjl/tEvx/d+X6tJLtxs6a/GBEOC5tLqtV6fVm80V I49hAuo1FFGEEghqUhDIEA8PbXfkoFpFAt1Cw8IWN/kkiaP9qW3SVndoJy62SGJuovn/YR eAg6sIyZ/aElt285hQalholf9eDe6FI5wHjH0Stpb4x1cDKVM/IiXlVYGoDTgmD2gzLpBj uBqmQKSeXl0+wAD9V3jyZfyBEVOUKGRd/czGxLoUAkettPMnLecTo1LFHQyHSvhuzQVBZV VJ0gcINsPzqPAb/dyCBHWiv4LiS8eE0f0CeQv7Ww2vRcCjKj6WodIvsXUK0ZzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by afedorov: URL: https://cgit.FreeBSD.org/src/commit/?id=009a56b2e416cf32b28be405876ab38bd7544d98 commit 009a56b2e416cf32b28be405876ab38bd7544d98 Author: Aleksandr Fedorov AuthorDate: 2022-02-05 15:47:46 +0000 Commit: Aleksandr Fedorov 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: