{
struct ifaddrs *ifaddrs, *ifa;
char *p;
- int i;
+ int i, sdl_type;
struct interface *ifp, *ifs, *ifl;
#ifdef __linux__
char ifn[IF_NAMESIZE];
syslog(LOG_ERR, "%s: up_interface: %m", ifp->name);
}
+ sdl_type = 0;
/* Don't allow loopback unless explicit */
if (ifp->flags & IFF_LOOPBACK) {
if (argc == 0 && ifac == 0) {
}
#endif
+ sdl_type = sdl->sdl_type;
switch(sdl->sdl_type) {
+ case IFT_BRIDGE: /* FALLTHROUGH */
+ case IFT_L2VLAN: /* FALLTHOUGH */
+ case IFT_L3IPVLAN: /* FALLTHROUGH */
case IFT_ETHER:
ifp->family = ARPHRD_ETHER;
break;
case IFT_IEEE1394:
ifp->family = ARPHRD_IEEE1394;
break;
+ case IFT_INFINIBAND:
+ ifp->family = ARPHRD_INFINIBAND;
+ break;
}
ifp->hwlen = sdl->sdl_alen;
#ifndef CLLADDR
memcpy(ifp->hwaddr, CLLADDR(sdl), ifp->hwlen);
#elif AF_PACKET
sll = (const struct sockaddr_ll *)(void *)ifa->ifa_addr;
- ifp->family = sll->sll_hatype;
+ ifp->family = sdl_type = sll->sll_hatype;
ifp->hwlen = sll->sll_halen;
if (ifp->hwlen != 0)
memcpy(ifp->hwaddr, sll->sll_addr, ifp->hwlen);
break;
default:
syslog(LOG_WARNING,
- "%s: unknown hardware family", p);
+ "%s: unsupported interface type %.2x"
+ ", falling back to ethernet",
+ ifp->name, sdl_type);
+ ifp->family = ARPHRD_ETHER;
+ break;
}
}