git: 24a81a968d21 - main - ifconfig: fix logical error in interface matching for '-l ether'
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 25 Aug 2023 17:33:18 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=24a81a968d21b3eef1a0a2d786859b274546bd34
commit 24a81a968d21b3eef1a0a2d786859b274546bd34
Author: Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2023-08-25 17:30:25 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2023-08-25 17:30:25 +0000
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
---
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 b26fbaf82776..1a7e5d07e601 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -768,7 +768,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);
}