diff options
author | Thomas Haller <thaller@redhat.com> | 2018-03-09 19:16:05 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-03-20 21:03:20 +0100 |
commit | 745d60c06ecccc7cbb0f916d5c62f3f72ac5e60b (patch) | |
tree | 0092edb25f8b20ce5bf618d634141b2f12038a02 | |
parent | 454195c09db12413c7feab4cf29e67ec5c1cd528 (diff) | |
download | NetworkManager-745d60c06ecccc7cbb0f916d5c62f3f72ac5e60b.tar.gz |
device: in nm_device_capture_initial_config() only update config once
Now that there is no difference between initial capturing of
the configuration, and a later update_ip_config() call during
a signal from platform, we only need to make sure that the
IP config instances are initialized at least once.
In case we are called multiple times, there is nothing to do.
-rw-r--r-- | src/devices/nm-device.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 3cedb7cf05..ad6bf835ec 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -263,6 +263,9 @@ typedef struct _NMDevicePrivate { bool queued_ip4_config_pending:1; bool queued_ip6_config_pending:1; + bool update_ip_config_completed_v4:1; + bool update_ip_config_completed_v6:1; + char * ip_iface; int ip_ifindex; NMDeviceType type; @@ -3626,6 +3629,9 @@ nm_device_realize_finish (NMDevice *self, const NMPlatformLink *plink) if (plink) device_recheck_slave_status (self, plink); + priv->update_ip_config_completed_v4 = FALSE; + priv->update_ip_config_completed_v6 = FALSE; + priv->real = TRUE; _notify (self, PROP_REAL); @@ -11415,6 +11421,11 @@ update_ip_config (NMDevice *self, int addr_family) nm_assert_addr_family (addr_family); + if (addr_family == AF_INET) + priv->update_ip_config_completed_v4 = TRUE; + else + priv->update_ip_config_completed_v6 = TRUE; + if (update_ext_ip_config (self, addr_family, TRUE)) { if (addr_family == AF_INET) { if (priv->ext_ip4_config) @@ -11429,8 +11440,12 @@ update_ip_config (NMDevice *self, int addr_family) void nm_device_capture_initial_config (NMDevice *self) { - update_ip_config (self, AF_INET); - update_ip_config (self, AF_INET6); + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + if (!priv->update_ip_config_completed_v4) + update_ip_config (self, AF_INET); + if (!priv->update_ip_config_completed_v6) + update_ip_config (self, AF_INET6); } static gboolean |