diff options
author | jeff <jeff@FreeBSD.org> | 2011-03-21 09:40:01 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2011-03-21 09:40:01 +0000 |
commit | 2d7d8c05e7404fbebf1f0fe24c13bc5bb58d2338 (patch) | |
tree | 79d67d85de5b498560d0272509bd0b1bfccf7d86 /usr.sbin/ndp | |
parent | 3420a736119b646db3defc2c3e24d534e35d73a0 (diff) | |
download | FreeBSD-src-2d7d8c05e7404fbebf1f0fe24c13bc5bb58d2338.zip FreeBSD-src-2d7d8c05e7404fbebf1f0fe24c13bc5bb58d2338.tar.gz |
- Merge changes to the base system to support OFED. These include
a wider arg2 for sysctl, updates to vlan code, IFT_INFINIBAND,
and other miscellaneous small features.
Diffstat (limited to 'usr.sbin/ndp')
-rw-r--r-- | usr.sbin/ndp/ndp.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index 1f62230..e245ac2 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -822,11 +822,15 @@ static char * ether_str(struct sockaddr_dl *sdl) { static char hbuf[NI_MAXHOST]; + char *cp; - if (sdl->sdl_alen > 0) + if (sdl->sdl_alen == ETHER_ADDR_LEN) { strlcpy(hbuf, ether_ntoa((struct ether_addr *)LLADDR(sdl)), sizeof(hbuf)); - else + } else if (sdl->sdl_alen) { + int n = sdl->sdl_nlen > 0 ? sdl->sdl_nlen + 1 : 0; + snprintf(hbuf, sizeof(hbuf), "%s", link_ntoa(sdl) + n); + } else snprintf(hbuf, sizeof(hbuf), "(incomplete)"); return(hbuf); |