From nobody Wed Feb 15 20:30:23 2023 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 4PH8pR4mMcz3rJSn; Wed, 15 Feb 2023 20:30:23 +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 4PH8pR2xYqz3F0s; Wed, 15 Feb 2023 20:30:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676493023; 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=DnrPyMGSSjqbXC4tAGTD4BaU3Cvmh7o9VLQpXeIOd+M=; b=RTPYuYIIzPN3j4tXAPXK1n009607TgBblppdZRK4UJ12xwWHF1SkKG+68pXT0xbzbvkhCa 3ufy1jP/yvedmfsOm8fllLFeRvJDmmeG1vDhPxoTaJOx83/ZPKYVWk5otR80A6U0qGlhoF wE5jJPv3KyXjaXj6azbJ03tJWwXH487wQTAjWzn0/QtLeG7QYedQ2SZP7h0BRIbMuMB5Kq 9/7H4BL4exOWWAcyvJ5l0jzwWIpJ7Q0L+IymFP8dli+TlANx1Sa1oDuf2Ce4MTZJpBYsas +2ucMDQMoh+xyp5ksm6mbhf/xY2MKtvXK1toVj4Dw2a96GehK7zN6/On3eGDfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676493023; 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=DnrPyMGSSjqbXC4tAGTD4BaU3Cvmh7o9VLQpXeIOd+M=; b=gV19yWGwSYzVG4irevwKMGLRXPKcm0hrMDrDLRIfZUuXjfovvI+juLjk1kzmqc0vmuGAS/ YoJ/hP+9dUuIbKrUMCQalybz5wjY3H6KAb9ezC/NeLDn3syYl4Sghfldsu6EpK0717hFRU HokCQQeACL5dPtJGfV6ooIxYSW2k2aTdwBOeESmwvhawHGczK5b+5A9I/cPq0ICB9VFDAF go2bMM5z9+pWtTufHWOaTOTKNxQE0ekuUMcyxQnaqAZ/06h+TJCbX5zQL8pLXV+i65ceVf +TX2sr+46/CV7DfxB3cdK3Z5Za9Fb8DuhF0QmwOgdYj3GW5aHuDUgtQni+21Sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676493023; a=rsa-sha256; cv=none; b=xj23gk3YchwutASpLefMNhX0LZglNImf8yYZxx+8kjAQMURXmw0if4R71fjuTqiZtZybRH BJBcHnnUMLBX7c7c6/Qs16mK+V0UM7dLqev4zyPJM6wr6ZCKrmugqAyQjvod/WhVPLKvGr Y+sKJJv2meQqt0y8hYLCSCNdC5RlzCW91Q8dqF6GhA9Q3ItTLXhAv3n3pyGuuDwOoJfYi0 7oQYUs/9krCf9D0XlW7qJ3rIrwlqmi7N8jYPYEVd7n/8qFlJu53s7DHmTLL9cH4ImANmks QjA4kM1LYTij78QTlgwT3P8IPWWmWK+ubtg6SeGxPtRib2b2Ahax1QmKPqHbsg== 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 4PH8pR21LTzd6v; Wed, 15 Feb 2023 20:30:23 +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 31FKUNLu027802; Wed, 15 Feb 2023 20:30:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FKUN21027801; Wed, 15 Feb 2023 20:30:23 GMT (envelope-from git) Date: Wed, 15 Feb 2023 20:30:23 GMT Message-Id: <202302152030.31FKUN21027801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 5dd48f718433 - main - netlink: use ifmedia to provide vlan interface operstate. 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: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5dd48f718433959c283a8a4d6e46512426f1e200 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=5dd48f718433959c283a8a4d6e46512426f1e200 commit 5dd48f718433959c283a8a4d6e46512426f1e200 Author: Alexander V. Chernikov AuthorDate: 2023-02-15 20:22:47 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-15 20:22:47 +0000 netlink: use ifmedia to provide vlan interface operstate. Netlink customers rely on admin and operational state when working with interfaces. The current implementation retuns "unknown" operstate for all interface types except IFT_ETHER and IFT_LOOP. This change updates the code to fetch vlan operstate in the same way as for the ether interfaces. For the rest of the interface types, operstate is now mapped to the admin state. Reported by: Marek Zarychta MFC after: 3 days --- sys/netlink/route/iface.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netlink/route/iface.c b/sys/netlink/route/iface.c index f4936bb2c35b..9cd7e6e80f3c 100644 --- a/sys/netlink/route/iface.c +++ b/sys/netlink/route/iface.c @@ -174,9 +174,11 @@ get_operstate(struct ifnet *ifp, struct if_state *pstate) switch (ifp->if_type) { case IFT_ETHER: + case IFT_L2VLAN: get_operstate_ether(ifp, pstate); break; - case IFT_LOOP: + default: + /* Map admin state to the operstate */ if (ifp->if_flags & IFF_UP) { pstate->ifla_operstate = IF_OPER_UP; pstate->ifla_carrier = 1;