aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/net/if_nameindex.c
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2012-05-19 02:39:43 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2012-05-19 02:39:43 +0000
commitcf0d539f8ba172e983e81349d5399c304afc41e3 (patch)
tree07ca34fb7f517054627aaba05428f1a326f84c4c /lib/libc/net/if_nameindex.c
parent29d8e665ba0b513c15716f35062b7991dc6adc16 (diff)
downloadsrc-cf0d539f8ba172e983e81349d5399c304afc41e3.tar.gz
src-cf0d539f8ba172e983e81349d5399c304afc41e3.zip
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.
Notes
Notes: svn path=/head/; revision=235640
Diffstat (limited to 'lib/libc/net/if_nameindex.c')
-rw-r--r--lib/libc/net/if_nameindex.c2
1 files changed, 1 insertions, 1 deletions
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++;