struct if_head *ifs;
struct interface *ifp;
struct if_spec spec;
+ bool if_noconf;
#ifdef AF_LINK
const struct sockaddr_dl *sdl;
#ifdef IFLR_ACTIVE
continue;
}
-#define IF_NOCONF ((argc == 0 || argc == -1) && ctx->ifac == 0 && \
- !if_hasconf(ctx, spec.devname))
+ if_noconf = ((argc == 0 || argc == -1) && ctx->ifac == 0 &&
+ !if_hasconf(ctx, spec.devname));
/* Don't allow loopback or pointopoint unless explicit.
* Don't allow some reserved interface names unless explicit. */
- if (IF_NOCONF) {
+ if (if_noconf) {
if (ifa->ifa_flags & (IFF_LOOPBACK | IFF_POINTOPOINT) ||
if_ignore(ctx, spec.devname))
active = IF_INACTIVE;
#endif
case IFT_PPP:
/* Don't allow unless explicit */
- if ((argc == 0 || argc == -1) &&
- ctx->ifac == 0 && active &&
- !if_hasconf(ctx, ifp->name))
- {
+ if (if_noconf) {
logdebugx("%s: ignoring due to"
" interface type and"
" no config",
ifp->name);
active = IF_INACTIVE;
}
+ __fallthrough; /* appease gcc */
/* FALLTHROUGH */
#ifdef IFT_L2VLAN
case IFT_L2VLAN: /* FALLTHROUGH */
#ifdef IFT_L3IPVLAN
case IFT_L3IPVLAN: /* FALLTHROUGH */
#endif
- /* FALLTHROUGH */
case IFT_ETHER:
ifp->family = ARPHRD_ETHER;
break;
#endif
default:
/* Don't allow unless explicit */
- if (IF_NOCONF)
+ if (if_noconf)
active = IF_INACTIVE;
if (active)
logwarnx("%s: unsupported"
- " interface type %.2x",
+ " interface type 0x%.2x",
ifp->name, sdl->sdl_type);
/* Pretend it's ethernet */
ifp->family = ARPHRD_ETHER;
default:
if (active)
logwarnx("%s: unsupported"
- " interface family %.2x",
+ " interface family 0x%.2x",
ifp->name, ifp->family);
break;
#endif