ndp.c (217140) | ndp.c (219819) |
---|---|
1/* $FreeBSD: head/usr.sbin/ndp/ndp.c 217140 2011-01-08 01:57:23Z delphij $ */ | 1/* $FreeBSD: head/usr.sbin/ndp/ndp.c 219819 2011-03-21 09:40:01Z jeff $ */ |
2/* $KAME: ndp.c,v 1.104 2003/06/27 07:48:39 itojun Exp $ */ 3 4/* 5 * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 807 unchanged lines hidden (view full) --- 817 close(s); 818 return(&nbi); 819} 820 821static char * 822ether_str(struct sockaddr_dl *sdl) 823{ 824 static char hbuf[NI_MAXHOST]; | 2/* $KAME: ndp.c,v 1.104 2003/06/27 07:48:39 itojun Exp $ */ 3 4/* 5 * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 807 unchanged lines hidden (view full) --- 817 close(s); 818 return(&nbi); 819} 820 821static char * 822ether_str(struct sockaddr_dl *sdl) 823{ 824 static char hbuf[NI_MAXHOST]; |
825 char *cp; |
|
825 | 826 |
826 if (sdl->sdl_alen > 0) | 827 if (sdl->sdl_alen == ETHER_ADDR_LEN) { |
827 strlcpy(hbuf, ether_ntoa((struct ether_addr *)LLADDR(sdl)), 828 sizeof(hbuf)); | 828 strlcpy(hbuf, ether_ntoa((struct ether_addr *)LLADDR(sdl)), 829 sizeof(hbuf)); |
829 else | 830 } else if (sdl->sdl_alen) { 831 int n = sdl->sdl_nlen > 0 ? sdl->sdl_nlen + 1 : 0; 832 snprintf(hbuf, sizeof(hbuf), "%s", link_ntoa(sdl) + n); 833 } else |
830 snprintf(hbuf, sizeof(hbuf), "(incomplete)"); 831 832 return(hbuf); 833} 834 835int 836ndp_ether_aton(a, n) 837 char *a; --- 798 unchanged lines hidden --- | 834 snprintf(hbuf, sizeof(hbuf), "(incomplete)"); 835 836 return(hbuf); 837} 838 839int 840ndp_ether_aton(a, n) 841 char *a; --- 798 unchanged lines hidden --- |