From 52ff8883185ad6ffa21fd0d01db1426e5c13af83 Mon Sep 17 00:00:00 2001 From: "Alexander V. Chernikov" Date: Wed, 14 Jun 2023 10:37:07 +0000 Subject: ifconfig: fix ifconfig crash when compiled w/WITHOUT_NETLINK. Properly update the recently-introduced `ctx->ifname` when iterating over interfaces. Reported by: Gary Jennejohn MFC after: 2 weeks --- sbin/ifconfig/ifconfig.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index d30d3e1909ae..6a80ad5763b2 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -822,6 +822,7 @@ list_interfaces_ioctl(if_ctx *ctx) continue; if (!group_member(ifa->ifa_name, args->matchgroup, args->nogroup)) continue; + ctx->ifname = cp; /* * Are we just listing the interfaces? */ -- cgit v1.2.3