From cf0d539f8ba172e983e81349d5399c304afc41e3 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Sat, 19 May 2012 02:39:43 +0000 Subject: Use the LLINDEX macro to access the link-level I/F index. This makes it possible to work with a different type for the sdl_index field -- it only requires a recompile. Obtained from: Juniper Networks, Inc. --- lib/libc/net/if_nameindex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libc/net/if_nameindex.c') diff --git a/lib/libc/net/if_nameindex.c b/lib/libc/net/if_nameindex.c index 7a12d34b58e7..138289c6814e 100644 --- a/lib/libc/net/if_nameindex.c +++ b/lib/libc/net/if_nameindex.c @@ -123,7 +123,7 @@ if_nameindex(void) if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_LINK) { ifni2->if_index = - ((struct sockaddr_dl*)ifa->ifa_addr)->sdl_index; + LLINDEX((struct sockaddr_dl*)ifa->ifa_addr); ifni2->if_name = cp; strcpy(cp, ifa->ifa_name); ifni2++; -- cgit v1.2.3