diff options
author | Dan Williams <dcbw@redhat.com> | 2014-10-14 11:41:36 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2014-10-27 13:46:06 -0500 |
commit | 2bf7d6b5db5093a78a3dbced9ad39a54a3fe907d (patch) | |
tree | 0dec0e188662b9ff1225c7a37c41ca94bfbfab05 | |
parent | 9e1d31763b282132d7ce86fc8c21b347bce02084 (diff) | |
download | NetworkManager-2bf7d6b5db5093a78a3dbced9ad39a54a3fe907d.tar.gz |
core: loosen master device carrier check before IP configuration
Previously a master device would wait for a carrier before starting
IP configuration only for 'manual' connections, but that's not quite
broad enough. We also want to allow SHARED methods to proceed
immediately since they are also effectively static/manual configuration.
Use the newly split out methods for checking whether a connection
requires a carrier or not to allow the SHARED method to proceed
for master devices without a carrier.
For example, this allows bridge configurations with tun/tap ports
to set up SHARED addressing before the tun/tap gets a carrier which
only happens when something opens the other side of the tun/tap
(like the VM or container).
-rw-r--r-- | src/devices/nm-device.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 1597d18faf..87bebdb1eb 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -2994,9 +2994,7 @@ act_stage3_ip4_config_start (NMDevice *self, connection = nm_device_get_connection (self); g_assert (connection); - method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP4_CONFIG); - - if ( strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL) != 0 + if ( connection_ip4_method_requires_carrier (connection, NULL) && priv->is_master && !priv->carrier) { _LOGI (LOGD_IP4 | LOGD_DEVICE, @@ -3019,6 +3017,8 @@ act_stage3_ip4_config_start (NMDevice *self, } } + method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP4_CONFIG); + /* Start IPv4 addressing based on the method requested */ if (strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0) ret = dhcp4_start (self, connection, reason); @@ -4011,9 +4011,7 @@ act_stage3_ip6_config_start (NMDevice *self, connection = nm_device_get_connection (self); g_assert (connection); - method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP6_CONFIG); - - if ( strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL) != 0 + if ( connection_ip4_method_requires_carrier (connection, NULL) && priv->is_master && !priv->carrier) { _LOGI (LOGD_IP6 | LOGD_DEVICE, @@ -4038,6 +4036,8 @@ act_stage3_ip6_config_start (NMDevice *self, priv->dhcp6_mode = NM_RDISC_DHCP_LEVEL_NONE; + method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP6_CONFIG); + if (strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE) == 0) { if (!priv->master) { /* When activating an IPv6 'ignore' connection we need to revert back |