From 9186bb10c16a274d78a8d4586ef81bb01a3dbd64 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Fri, 25 Aug 2023 10:30:25 -0700 Subject: [PATCH] ifconfig: fix logical error in interface matching for '-l ether' This affects only ifconfig(8) compiled WITHOUT_NETLINK_SUPPORT, which is not the default. Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D41584 Fixes: d1cd0344f7b7d81beda04c3cb8cfee99351c3eb8 (cherry picked from commit 24a81a968d21b3eef1a0a2d786859b274546bd34) --- sbin/ifconfig/ifconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index ccc783c64ff..f4ac045bcce 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -771,7 +771,7 @@ match_afp(const struct afswtch *afp, int sa_family, const struct sockaddr_dl *sd return (true); /* special case for "ether" address family */ if (!strcmp(afp->af_name, "ether")) { - if (sdl == NULL && !match_ether(sdl)) + if (sdl == NULL || !match_ether(sdl)) return (false); return (true); }