| 871 | } |
| 872 | |
| 873 | static char * |
| 874 | ether_str(struct sockaddr_dl *sdl) |
| 875 | { |
| 876 | static char hbuf[NI_MAXHOST]; |
| 877 | |
| 878 | if (sdl->sdl_alen == ETHER_ADDR_LEN) { |
| 879 | strlcpy(hbuf, ether_ntoa((struct ether_addr *)LLADDR(sdl)), |
| 880 | sizeof(hbuf)); |
| 881 | } else if (sdl->sdl_alen) { |
| 882 | int n = sdl->sdl_nlen > 0 ? sdl->sdl_nlen + 1 : 0; |
| 883 | snprintf(hbuf, sizeof(hbuf), "%s", link_ntoa(sdl) + n); |
| 884 | } else |
| 885 | snprintf(hbuf, sizeof(hbuf), "(incomplete)"); |
| 886 | |
| 887 | return(hbuf); |
| 888 | } |
| 889 | |
| 890 | static int |
| 891 | ndp_ether_aton(char *a, u_char *n) |