device: avoid touching IPv6 on "external" connections without IPv6 conf

When a device managed by NetworkManager is configured manually (adding
ip addresses), NetworkManager will track the device configuration with
an in-memory only config, marking the device as "external".
Devices marked external should be just tracked but left untouched.
This does not happens on current code base: if an ipv4 address is added,
NM generates the in-memory connection, marking the ipv6.method as "ignore".
While activating the connection, NM will process the IPv6 "ignore" method:
this implies leaving the IPv6LL address generation to the kernel. To
trigger this NM will disable/enable IPv6 on the interface.
This not only may change the device configuration but may cause also
a potential race with an external IPv6 assignment on the device.

NetworkManager should do nothing to IPv6 when method is "ignore" and
connection is marked as "external": this commit fixes this behavior.
Note that if/once an IPv6 address is externally added, IPv6 method in the
tracked connection is changed to "manual" and a link local address will be
generated if needed.

https://bugzilla.redhat.com/show_bug.cgi?id=1462260
This commit is contained in:
Francesco Giudici 2017-09-19 18:25:21 +02:00
parent 2f66fbf32d
commit 15344be0e1

View file

@ -7765,7 +7765,8 @@ act_stage3_ip6_config_start (NMDevice *self,
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) {
if ( !priv->master
&& !nm_device_sys_iface_state_is_external (self)) {
gboolean old_nm_ipv6ll = priv->nm_ipv6ll;
/* When activating an IPv6 'ignore' connection we need to revert back