From nobody Thu Feb 5 18:12:18 2026 X-Original-To: dev-commits-src-branches@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 4f6QKv0cXkz6Qyhj for ; Thu, 05 Feb 2026 18:12:19 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f6QKt5rXLz45T2 for ; Thu, 05 Feb 2026 18:12:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770315138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=45T44o3JVNHKGq6K/Kiah0IBt8G+W3vSiGdbPY/cL7k=; b=VB0QHD3VJNwCJBKIRwM6/8mGqBvdpFpRzkBZAsXnRAkfy7VMYdzp2Iz70hdsRh2JLm4oB5 4k14aasvUihGtivk73hMhcASS3qI5IZhfjmDZ4qSzeEjzYoWNKeQ2widSeobvvwBs54odY NYR/V8uFgRAqRVXxx5/Yei2SMnCD4Moflg0oHHPOhEDGsWXIFZHyNos/qlAUmBP8RlR0Tw BZHf/wu9iW+oBPASrmwE4pMxfYamWJuAWFNxeCZziGExdrw8rA0Dg4c/CtHJzTxPfpUULy 1vikT6ubn2ehlLas7DaT3ycEyNHwZf60F7iGsL5NtaEB3wd2wsw5tVkTtxpkNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770315138; a=rsa-sha256; cv=none; b=EzuMX5xdYX1+9yi0Pt3ToOcRggn36Qnpu7HObNzn41jfma0r3wb+ydTFE6ujzNennVz+XV 6AxEuX2JVKrL2FHw/iPeqc4EkVUQKYj7+DWjwDKxf54IjLQ6xCe882Wywt+OXz9ybLK3Du j+tqFrCtn3s71BxQko7vT2m2P9JaC1RZrNDZdOvqer6DUClTO1s6Z7tdUee+QNZNdnR29i 5I7yiV0zEQ8PKM0Y2w+i+fhSeNQlYlMo1dxzzqjMA8KFjMPU15FlQiI6+F3+MMju40OnnJ FUp0gJA5nIFhGC1IyocmkwPwrfKfox9dff4lhWAFWutfsAFL7aopSP4E6p2aDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770315138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=45T44o3JVNHKGq6K/Kiah0IBt8G+W3vSiGdbPY/cL7k=; b=sTh82eJfiRvCPULAhj6OlsNUMYJc5oXEwbLMpMBQkuzEcYIS5fmuvPd7pUbK/z9XLSUm6+ ZnbzOI+0t1tXNpvLpF/C5J3FI/vQ0B6OKbZyJEaayPvrozXfjxUqNRYrwPEQ5eajqFu3st idOeybvFjbL0faFSuSGrQfwhB6+/8U7WFhdNJGLqfSIVnoz3cVQL/AsCjI8cLH6f/W9ZLt Yc8XCCBDETvAO92W43bcGCyVS1UvSZ0opNWuYozOZIzxsycdKh4ukMpCYTwBwQ5VFCvMmp 9Z2HMVNx1EGcsgA9gpydzKNm6EXw/2KmUYaz3I+rR2jM6XHR8Y7heCA2m83utQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f6QKt56cPzh4v for ; Thu, 05 Feb 2026 18:12:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31d4f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 05 Feb 2026 18:12:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Gleb Smirnoff From: Zhenlei Huang Subject: git: 151dcad51394 - stable/14 - ifconfig: fix 'ifconfig -l ether' List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 151dcad51394e841f1cf3e798e5cdb4dd8131949 Auto-Submitted: auto-generated Date: Thu, 05 Feb 2026 18:12:18 +0000 Message-Id: <6984dd82.31d4f.78d19e9b@gitrepo.freebsd.org> The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=151dcad51394e841f1cf3e798e5cdb4dd8131949 commit 151dcad51394e841f1cf3e798e5cdb4dd8131949 Author: Gleb Smirnoff AuthorDate: 2023-08-25 17:31:26 +0000 Commit: Zhenlei Huang CommitDate: 2026-02-05 18:10:35 +0000 ifconfig: fix 'ifconfig -l ether' When matching interfaces for being Ethernet, use same trick that the link module does - pass if_type through convert_iftype(). That restores historicaly behaviour of listing lagg(4) ports. Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D41585 (cherry picked from commit 31016aa0be6dbf7556a91dda14cfe1ff0dcf933b) --- sbin/ifconfig/af_link.c | 11 ----------- sbin/ifconfig/ifconfig.h | 2 ++ sbin/ifconfig/ifconfig_netlink.c | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/sbin/ifconfig/af_link.c b/sbin/ifconfig/af_link.c index be58a22c0e66..55b75d847c16 100644 --- a/sbin/ifconfig/af_link.c +++ b/sbin/ifconfig/af_link.c @@ -160,17 +160,6 @@ pcp: } #else -static uint8_t -convert_iftype(uint8_t iftype) -{ - switch (iftype) { - case IFT_IEEE8023ADLAG: - return (IFT_ETHER); - case IFT_INFINIBANDLAG: - return (IFT_INFINIBAND); - } - return (iftype); -} static void link_status_nl(if_ctx *ctx, if_link_t *link, if_addr_t *ifa __unused) diff --git a/sbin/ifconfig/ifconfig.h b/sbin/ifconfig/ifconfig.h index 1ea6c29e4ddb..672020443b8c 100644 --- a/sbin/ifconfig/ifconfig.h +++ b/sbin/ifconfig/ifconfig.h @@ -38,6 +38,7 @@ #include #include +#include #define __constructor __attribute__((constructor)) @@ -291,6 +292,7 @@ struct afswtch *af_getbyfamily(int af); void af_other_status(if_ctx *ctx); void print_ifstatus(if_ctx *ctx); void print_metric(if_ctx *ctx); +ifType convert_iftype(ifType iftype); /* Netlink-related functions */ void list_interfaces_nl(struct ifconfig_args *args); diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c index 0ec63e3a0b99..aadd7d1096c3 100644 --- a/sbin/ifconfig/ifconfig_netlink.c +++ b/sbin/ifconfig/ifconfig_netlink.c @@ -203,6 +203,19 @@ if_nametoindex_nl(struct snl_state *ss, const char *ifname) return (link.ifi_index); } +ifType +convert_iftype(ifType iftype) +{ + switch (iftype) { + case IFT_IEEE8023ADLAG: + return (IFT_ETHER); + case IFT_INFINIBANDLAG: + return (IFT_INFINIBAND); + default: + return (iftype); + } +} + static void prepare_ifaddrs(struct snl_state *ss, struct ifmap *ifmap) { @@ -261,7 +274,7 @@ match_iface(struct ifconfig_args *args, struct iface *iface) struct sockaddr_dl sdl = { .sdl_len = sizeof(struct sockaddr_dl), .sdl_family = AF_LINK, - .sdl_type = link->ifi_type, + .sdl_type = convert_iftype(link->ifi_type), .sdl_alen = NLA_DATA_LEN(link->ifla_address), }; return (match_ether(&sdl));