changeset 2497:61ce8921b6cd draft

Check naming rules before calling dev_initialized.
author Roy Marples <roy@marples.name>
date Thu, 29 May 2014 11:12:09 +0000
parents 060f513c07b4
children a08798c4143c
files if.c
diffstat 1 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/if.c	Thu May 29 06:43:54 2014 +0000
+++ b/if.c	Thu May 29 11:12:09 2014 +0000
@@ -232,10 +232,6 @@
 #endif
 		}
 
-		/* Ensure that the interface name has settled */
-		if (!dev_initialized(ctx, ifa->ifa_name))
-			continue;
-
 		/* It's possible for an interface to have >1 AF_LINK.
 		 * For our purposes, we use the first one. */
 		TAILQ_FOREACH(ifp, ifs, next) {
@@ -281,10 +277,13 @@
 		if (ctx->ifac && i == ctx->ifac)
 			continue;
 
-		if (if_vimaster(ifa->ifa_name) == 1) {
+		/* Ensure that the interface name has settled */
+		if (!dev_initialized(ctx, p))
+			continue;
+
+		if (if_vimaster(p) == 1) {
 			syslog(argc ? LOG_ERR : LOG_DEBUG,
-				"%s: is a Virtual Interface Master, skipping",
-				ifa->ifa_name);
+			    "%s: is a Virtual Interface Master, skipping", p);
 			continue;
 		}