]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Only allow hardware families we know we can work with by default.
authorRoy Marples <roy@marples.name>
Wed, 5 Aug 2009 21:20:53 +0000 (21:20 +0000)
committerRoy Marples <roy@marples.name>
Wed, 5 Aug 2009 21:20:53 +0000 (21:20 +0000)
If an interface with a different hardware family is requested by the user then
emit a warning.

net.c

diff --git a/net.c b/net.c
index 3e49ee155345457e1fe228d06d788e3cd548054c..4c8be2fe3a61315582eaf2c4f7a3f2ec6c918a87 100644 (file)
--- 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;