summaryrefslogtreecommitdiffstats
path: root/src/if.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-09-19 14:40:50 +0100
committerRoy Marples <roy@marples.name>2020-09-19 14:40:50 +0100
commit1efd31813fde826b000fbc40234ea89979ef73a8 (patch)
treeff8f26cb8e5a13f34ebc319fe107e0ce4d77afbe /src/if.c
parent11963d2088a68a18ea61f27584a9339cd0292cac (diff)
downloaddhcpcd-1efd31813fde826b000fbc40234ea89979ef73a8.tar.xz
Linux: detect network namespace and deny udev in one
udev says whether an interface name is stable or not. In a network namespace, udev claims the interface does not exist. This makes sense because udev only operates in the root namespace. As such disable udev in a network namespace. While here correctly spell initialise.
Diffstat (limited to 'src/if.c')
-rw-r--r--src/if.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/if.c b/src/if.c
index 40fdadcf..cb407e19 100644
--- a/src/if.c
+++ b/src/if.c
@@ -519,8 +519,11 @@ if_discover(struct dhcpcd_ctx *ctx, struct ifaddrs **ifaddrs,
#ifdef PLUGIN_DEV
/* Ensure that the interface name has settled */
- if (!dev_initialized(ctx, spec.devname))
+ if (!dev_initialised(ctx, spec.devname)) {
+ logdebugx("%s: waiting for interface to initialise",
+ spec.devname);
continue;
+ }
#endif
if (if_vimaster(ctx, spec.devname) == 1) {