changeset 1388:3c9dc6607609 draft

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.
author Roy Marples <roy@marples.name>
date Wed, 05 Aug 2009 21:20:53 +0000
parents 9095245dd391
children ae874f090f35
files net.c
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/net.c	Wed Jul 29 08:59:52 2009 +0000
+++ b/net.c	Wed Aug 05 21:20:53 2009 +0000
@@ -351,6 +351,18 @@
 			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;