diff options
author | Jeff Roberson <jeff@FreeBSD.org> | 2011-03-21 09:40:01 +0000 |
---|---|---|
committer | Jeff Roberson <jeff@FreeBSD.org> | 2011-03-21 09:40:01 +0000 |
commit | e4cd31dd3c7adc94a486ca5309c7096f81fa70f1 (patch) | |
tree | 79d67d85de5b498560d0272509bd0b1bfccf7d86 /usr.sbin/ndp/ndp.c | |
parent | 0b626a289e9814fa1f14ea32280410521fc43224 (diff) | |
download | src-e4cd31dd3c7adc94a486ca5309c7096f81fa70f1.tar.gz src-e4cd31dd3c7adc94a486ca5309c7096f81fa70f1.zip |
- 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.
Notes
Notes:
svn path=/head/; revision=219819
Diffstat (limited to 'usr.sbin/ndp/ndp.c')
-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 1f62230cffcb..e245ac2976da 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); |