summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-01-26 15:34:02 +0100
committerThomas Haller <thaller@redhat.com>2015-01-26 17:56:03 +0100
commitddac52a61e838b6f2b7e103e2f94276c6dc41037 (patch)
tree58e133efcea7dfe671c02459a98a3fbdbda886b6
parentaadef137b4b2d75077246364877b114f0a63cf30 (diff)
downloadNetworkManager-ddac52a61e838b6f2b7e103e2f94276c6dc41037.tar.gz
device: schedule queued_ip_config_change() after constructing device
During queued_ip_config_change(), we eventually call update_ip_config() and ip4_config_merge_and_apply(). These functions read the IP configuration from platform and setup the private ip4_config instance. Trigger this initialization after constructing the device to setup the IP configuration. Before, for unmanaged devices we would not call ip4_config_merge_and_apply() until the first platform change event. Note that in the worst case we do some unnecessary work due to this, because queued_ip_config_change() must already be robust to be called at any time.
-rw-r--r--src/devices/nm-device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 9f5ca4b2bb..3bb65c487b 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -8213,6 +8213,9 @@ constructor (GType type,
g_signal_connect (platform, NM_PLATFORM_SIGNAL_IP6_ROUTE_CHANGED, G_CALLBACK (device_ip_changed), self);
g_signal_connect (platform, NM_PLATFORM_SIGNAL_LINK_CHANGED, G_CALLBACK (link_changed_cb), self);
+ /* trigger initial ip config change to initialize ip-config */
+ priv->queued_ip_config_id = g_idle_add (queued_ip_config_change, self);
+
if (nm_platform_check_support_user_ipv6ll ()) {
int ip_ifindex = nm_device_get_ip_ifindex (self);