summaryrefslogtreecommitdiffstats
path: root/if.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2014-05-29 11:12:09 +0000
committerRoy Marples <roy@marples.name>2014-05-29 11:12:09 +0000
commit5b76368086cda67a399b2d5180ac4fc0c9d42fd4 (patch)
tree478e691fbaa2c50a5e8576f19db0b0ab33c53398 /if.c
parent362153f5b4dde84c1a56320db935becf44a2db03 (diff)
downloaddhcpcd-5b76368086cda67a399b2d5180ac4fc0c9d42fd4.tar.xz
Check naming rules before calling dev_initialized.
Diffstat (limited to 'if.c')
-rw-r--r--if.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/if.c b/if.c
index 0aad1f6b..f4b8c7a9 100644
--- a/if.c
+++ b/if.c
@@ -232,10 +232,6 @@ if_discover(struct dhcpcd_ctx *ctx, int argc, char * const *argv)
#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_discover(struct dhcpcd_ctx *ctx, int argc, char * const *argv)
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;
}