From 56928500eceb7ff381e2eaf4ea08f36a743d072e Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Mon, 6 Mar 2023 11:36:31 -0500 Subject: [PATCH] linux: Use the if_name() accessor to get loopback name Avoid directly accessing the if_xname ifnet member. and use the designated accessor function instead. Sponsored by: Juniper Networks, Inc. --- sys/compat/linux/linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linux/linux.c b/sys/compat/linux/linux.c index dcf5ac1e689..47a6561264e 100644 --- a/sys/compat/linux/linux.c +++ b/sys/compat/linux/linux.c @@ -329,7 +329,7 @@ ifname_bsd_to_linux_ifp(struct ifnet *ifp, char *lxname, size_t len) * Linux loopback interface name is lo (not lo0), * we translate lo to lo0, loX to loX. */ - if (IFP_IS_LOOP(ifp) && strncmp(ifp->if_xname, "lo0", IFNAMSIZ) == 0) + if (IFP_IS_LOOP(ifp) && strncmp(if_name(ifp), "lo0", IFNAMSIZ) == 0) return (strlcpy(lxname, "lo", len)); /* Short-circuit non ethernet interfaces. */