changeset 1385:3a18dca86440 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:08:44 +0000
parents 6d86581b32c0
children 90ffa9d2be95
files net.c
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/net.c	Wed Aug 05 20:36:31 2009 +0000
+++ b/net.c	Wed Aug 05 21:08:44 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;