fix link_status() in non-Ethernet case

MFC after:	1 week
This commit is contained in:
Max Khon 2003-01-22 00:14:34 +00:00
parent afa79409ee
commit b8701b5430

View File

@ -1496,16 +1496,18 @@ xns_status(int s __unused, struct rt_addrinfo * info)
void
link_status(int s __unused, struct rt_addrinfo *info)
{
int n;
struct sockaddr_dl *sdl = (struct sockaddr_dl *)info;
if ((n = sdl->sdl_alen) > 0) {
if (sdl->sdl_alen > 0) {
if (sdl->sdl_type == IFT_ETHER &&
sdl->sdl_alen == ETHER_ADDR_LEN)
printf("\tether %s\n",
ether_ntoa((struct ether_addr *)LLADDR(sdl)));
else
printf("\tlladdr %s\n", link_ntoa(sdl) + n + 1);
else {
int n = sdl->sdl_nlen > 0 ? sdl->sdl_nlen + 1 : 0;
printf("\tlladdr %s\n", link_ntoa(sdl) + n);
}
}
}