From: Roy Marples Date: Wed, 5 Aug 2009 21:20:53 +0000 (+0000) Subject: Only allow hardware families we know we can work with by default. X-Git-Tag: v5.0.8~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a74873aebad463c70fbff15bb4ee6287a109fa47;p=thirdparty%2Fdhcpcd.git Only allow hardware families we know we can work with by default. If an interface with a different hardware family is requested by the user then emit a warning. --- diff --git a/net.c b/net.c index 3e49ee15..4c8be2fe 100644 --- a/net.c +++ b/net.c @@ -351,6 +351,18 @@ discover_interfaces(int argc, char * const *argv) if (ifp->hwlen != 0) memcpy(ifp->hwaddr, sll->sll_addr, ifp->hwlen); #endif + + switch(ifp->family) { + case ARPHRD_ETHER: /* FALLTHROUGH */ + case ARPHRD_IEEE1394: + break; + default: + if (argc == 0 && ifac == 0) { + free_interface(ifp); + continue; + } + syslog(LOG_WARNING, "%s: unknown hardware family", p); + } } if (ifl) ifl->next = ifp;