diff options
author | sam <sam@FreeBSD.org> | 2007-02-24 23:55:46 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2007-02-24 23:55:46 +0000 |
commit | cd822ec72803ef63ba2d56e1fcdc837cd656a1b5 (patch) | |
tree | c3dc617e94bd4dffc5a8ead0c6679f2de41ca65d /sbin/ifconfig/af_link.c | |
parent | a95c51b9e7cc53e67b4c98f5bbf806aa8df2e32c (diff) | |
download | FreeBSD-src-cd822ec72803ef63ba2d56e1fcdc837cd656a1b5.zip FreeBSD-src-cd822ec72803ef63ba2d56e1fcdc837cd656a1b5.tar.gz |
use getifaddrs from libc instead of private code
Reviewed by: bms
MFC after: 1 month
Diffstat (limited to 'sbin/ifconfig/af_link.c')
-rw-r--r-- | sbin/ifconfig/af_link.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sbin/ifconfig/af_link.c b/sbin/ifconfig/af_link.c index d610750..f77515e 100644 --- a/sbin/ifconfig/af_link.c +++ b/sbin/ifconfig/af_link.c @@ -36,12 +36,12 @@ static const char rcsid[] = #include <sys/ioctl.h> #include <sys/socket.h> #include <net/if.h> -#include <net/route.h> /* for RTX_IFA */ #include <err.h> #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <ifaddrs.h> #include <net/if_dl.h> #include <net/if_types.h> @@ -52,16 +52,16 @@ static const char rcsid[] = static struct ifreq link_ridreq; static void -link_status(int s __unused, const struct rt_addrinfo *info) +link_status(int s __unused, const struct ifaddrs *ifa) { - const struct sockaddr_dl *sdl = - (const struct sockaddr_dl *) info->rti_info[RTAX_IFA]; + /* XXX no const 'cuz LLADDR is defined wrong */ + struct sockaddr_dl *sdl = (struct sockaddr_dl *) ifa->ifa_addr; if (sdl != NULL && sdl->sdl_alen > 0) { if (sdl->sdl_type == IFT_ETHER && sdl->sdl_alen == ETHER_ADDR_LEN) printf("\tether %s\n", - ether_ntoa((const struct ether_addr *)LLADDR(sdl))); + ether_ntoa((struct ether_addr *)LLADDR(sdl))); else { int n = sdl->sdl_nlen > 0 ? sdl->sdl_nlen + 1 : 0; |