summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-08-05 21:20:53 +0000
committerRoy Marples <roy@marples.name>2009-08-05 21:20:53 +0000
commita74873aebad463c70fbff15bb4ee6287a109fa47 (patch)
tree9029e78984ea3fd3683d29ae3089a94327a54bc4
parent0593a31e53921ac55e6766876369a4d4664e641e (diff)
downloaddhcpcd-a74873aebad463c70fbff15bb4ee6287a109fa47.tar.xz
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.
-rw-r--r--net.c12
1 files changed, 12 insertions, 0 deletions
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;