diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2015-10-21 14:57:23 +0200 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2015-10-21 17:06:01 +0200 |
commit | a9fbddedd72150bde819e595a2a6e59bc38061f1 (patch) | |
tree | 61a8b8e748e23c40b00d754af3a5f725665bd98e | |
parent | 2631174d4eeb4ae167bca5a2f5eeb3ad9eb041e1 (diff) | |
download | NetworkManager-jk/fix-software-device-unmanaged-rh1273879.tar.gz |
vlan: fix unmanaged VLAN interface problem (rh #1273879)jk/fix-software-device-unmanaged-rh1273879
Commit 285ee1fda2052e5b59110a323082c9423bf882e0 added NM_UNMANAGED_PLATFORM_INIT
flag marking platform uninitialized devices. The flags is set by
NM_DEVICE_PLATFORM_DEVICE property and on link changes. However, for virtual
devices, the platform device property was not set at NM device construction time
and link change event happened even before. That resulted in the device having
platform_link_initialized=FALSE and thus it was left unmanaged.
https://bugzilla.redhat.com/show_bug.cgi?id=1273879
-rw-r--r-- | src/devices/nm-device-bond.c | 14 | ||||
-rw-r--r-- | src/devices/nm-device-bridge.c | 4 | ||||
-rw-r--r-- | src/devices/nm-device-infiniband.c | 4 | ||||
-rw-r--r-- | src/devices/nm-device-vlan.c | 4 | ||||
-rw-r--r-- | src/devices/team/nm-device-team.c | 4 |
5 files changed, 20 insertions, 10 deletions
diff --git a/src/devices/nm-device-bond.c b/src/devices/nm-device-bond.c index 7f1394248d..afcba3b3a5 100644 --- a/src/devices/nm-device-bond.c +++ b/src/devices/nm-device-bond.c @@ -572,6 +572,7 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, { const char *iface = nm_connection_get_interface_name (connection); NMPlatformError plerr; + const NMPlatformLink *plink; g_assert (iface); @@ -584,14 +585,15 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, nm_platform_error_to_string (plerr)); return NULL; } + plink = nm_platform_link_get_by_ifname (NM_PLATFORM_GET, iface); return (NMDevice *) g_object_new (NM_TYPE_DEVICE_BOND, - NM_DEVICE_IFACE, iface, - NM_DEVICE_DRIVER, "bonding", - NM_DEVICE_TYPE_DESC, "Bond", - NM_DEVICE_DEVICE_TYPE, NM_DEVICE_TYPE_BOND, - NM_DEVICE_IS_MASTER, TRUE, - NULL); + NM_DEVICE_PLATFORM_DEVICE, plink, + NM_DEVICE_DRIVER, "bonding", + NM_DEVICE_TYPE_DESC, "Bond", + NM_DEVICE_DEVICE_TYPE, NM_DEVICE_TYPE_BOND, + NM_DEVICE_IS_MASTER, TRUE, + NULL); } NM_DEVICE_FACTORY_DEFINE_INTERNAL (BOND, Bond, bond, diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c index e1cafd604a..d643553010 100644 --- a/src/devices/nm-device-bridge.c +++ b/src/devices/nm-device-bridge.c @@ -498,6 +498,7 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, const char *mac_address_str; guint8 mac_address[NM_UTILS_HWADDR_LEN_MAX]; NMPlatformError plerr; + const NMPlatformLink *plink; g_assert (iface); @@ -523,9 +524,10 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, nm_platform_error_to_string (plerr)); return NULL; } + plink = nm_platform_link_get_by_ifname (NM_PLATFORM_GET, iface); return (NMDevice *) g_object_new (NM_TYPE_DEVICE_BRIDGE, - NM_DEVICE_IFACE, iface, + NM_DEVICE_PLATFORM_DEVICE, plink, NM_DEVICE_DRIVER, "bridge", NM_DEVICE_TYPE_DESC, "Bridge", NM_DEVICE_DEVICE_TYPE, NM_DEVICE_TYPE_BRIDGE, diff --git a/src/devices/nm-device-infiniband.c b/src/devices/nm-device-infiniband.c index 2d519f6111..c1571fd910 100644 --- a/src/devices/nm-device-infiniband.c +++ b/src/devices/nm-device-infiniband.c @@ -327,6 +327,7 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, int p_key, parent_ifindex; const char *iface; NMPlatformError plerr; + const NMPlatformLink *plink; if (!NM_IS_DEVICE_INFINIBAND (parent)) { g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED, @@ -352,9 +353,10 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, nm_platform_error_to_string (plerr)); return NULL; } + plink = nm_platform_link_get_by_ifname (NM_PLATFORM_GET, iface); return (NMDevice *) g_object_new (NM_TYPE_DEVICE_INFINIBAND, - NM_DEVICE_IFACE, iface, + NM_DEVICE_PLATFORM_DEVICE, plink, NM_DEVICE_DRIVER, nm_device_get_driver (parent), NM_DEVICE_TYPE_DESC, "InfiniBand", NM_DEVICE_DEVICE_TYPE, NM_DEVICE_TYPE_INFINIBAND, diff --git a/src/devices/nm-device-vlan.c b/src/devices/nm-device-vlan.c index adfcef3468..b330397f2d 100644 --- a/src/devices/nm-device-vlan.c +++ b/src/devices/nm-device-vlan.c @@ -698,6 +698,7 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, NMSettingVlan *s_vlan; gs_free char *iface = NULL; NMPlatformError plerr; + const NMPlatformLink *plink; if (!NM_IS_DEVICE (parent)) { g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED, @@ -728,9 +729,10 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, nm_platform_error_to_string (plerr)); return NULL; } + plink = nm_platform_link_get_by_ifname (NM_PLATFORM_GET, iface); device = (NMDevice *) g_object_new (NM_TYPE_DEVICE_VLAN, - NM_DEVICE_IFACE, iface, + NM_DEVICE_PLATFORM_DEVICE, plink, NM_DEVICE_VLAN_INT_PARENT_DEVICE, parent, NM_DEVICE_DRIVER, "8021q", NM_DEVICE_TYPE_DESC, "VLAN", diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c index 09b2dd7d7a..1950fd2ae5 100644 --- a/src/devices/team/nm-device-team.c +++ b/src/devices/team/nm-device-team.c @@ -710,6 +710,7 @@ nm_device_team_new_for_connection (NMConnection *connection, GError **error) { const char *iface = nm_connection_get_interface_name (connection); NMPlatformError plerr; + const NMPlatformLink *plink; g_assert (iface); @@ -722,9 +723,10 @@ nm_device_team_new_for_connection (NMConnection *connection, GError **error) nm_platform_error_to_string (plerr)); return NULL; } + plink = nm_platform_link_get_by_ifname (NM_PLATFORM_GET, iface); return (NMDevice *) g_object_new (NM_TYPE_DEVICE_TEAM, - NM_DEVICE_IFACE, iface, + NM_DEVICE_PLATFORM_DEVICE, plink, NM_DEVICE_DRIVER, "team", NM_DEVICE_TYPE_DESC, "Team", NM_DEVICE_DEVICE_TYPE, NM_DEVICE_TYPE_TEAM, |