summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2014-11-21 15:02:37 +0100
committerLubomir Rintel <lkundrak@v3.sk>2014-11-21 15:10:49 +0100
commit09248714525cfa07e5b665af8855fd6011300411 (patch)
tree696f7704d3c715dace1e4a04d8dc9a1f14868d5c /src
parent4b7a736c4026451981b863cc4df2d4a2451a2f0c (diff)
downloadNetworkManager-lr/no-udev.tar.gz
platform: Don't wait for udev device initializaton in a cointainerlr/no-udev
There's no udev there, it only starts if /sys is writable. If a hardware device is added to the container's namespace NM would not announce it. Remove the software link special case, the software links now won't wait for udev initialization as well.
Diffstat (limited to 'src')
-rw-r--r--src/platform/nm-linux-platform.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index 391f1758db..efb9c4d67c 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -836,10 +836,6 @@ link_is_announceable (NMPlatform *platform, struct rtnl_link *rtnllink)
{
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform);
- /* Software devices are always visible outside the platform */
- if (link_is_software (rtnllink))
- return TRUE;
-
/* Hardware devices must be found by udev so rules get run and tags set */
if (g_hash_table_lookup (priv->udev_devices,
GINT_TO_POINTER (rtnl_link_get_ifindex (rtnllink))))
@@ -4220,7 +4216,12 @@ setup (NMPlatform *platform)
/* And read initial device list */
enumerator = g_udev_enumerator_new (priv->udev_client);
g_udev_enumerator_add_match_subsystem (enumerator, "net");
- g_udev_enumerator_add_match_is_initialized (enumerator);
+
+ /* Demand that the device is initialized (udev rules ran,
+ * device has a stable name now) in case udev is running
+ * (not in a container). */
+ if (access ("/sys", W_OK) == 0)
+ g_udev_enumerator_add_match_is_initialized (enumerator);
devices = g_udev_enumerator_execute (enumerator);
for (iter = devices; iter; iter = g_list_next (iter)) {