Skip to content

Commit 5692850

Browse files
committed
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.
1 parent 0848462 commit 5692850

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sys/compat/linux/linux.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ ifname_bsd_to_linux_ifp(struct ifnet *ifp, char *lxname, size_t len)
329329
* Linux loopback interface name is lo (not lo0),
330330
* we translate lo to lo0, loX to loX.
331331
*/
332-
if (IFP_IS_LOOP(ifp) && strncmp(ifp->if_xname, "lo0", IFNAMSIZ) == 0)
332+
if (IFP_IS_LOOP(ifp) && strncmp(if_name(ifp), "lo0", IFNAMSIZ) == 0)
333333
return (strlcpy(lxname, "lo", len));
334334

335335
/* Short-circuit non ethernet interfaces. */

0 commit comments

Comments
 (0)