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.
This commit is contained in:
Thomas Haller 2015-01-26 15:34:02 +01:00
parent aadef137b4
commit ddac52a61e

View file

@ -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);