From 7070d17cedd09d07f12ce977dd1e16cecf8d4b45 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 25 Sep 2017 14:28:16 +0200 Subject: [PATCH] device: reset @con_ip6_config on failure before RA If the commit of static connection parameters fails before starting RA, we should reset @con_ip6_config; otherwise any external update arriving before the commit of RA parameters will remove from @con_ip6_config all parameters not present externally, because in update_ip6_config() we do: /* This function was called upon external changes. Remove the configuration * (addresses,routes) that is no longer present externally from the internal * config. This way, we don't re-add addresses that were manually removed * by the user. */ if (priv->con_ip6_config) nm_ip6_config_intersect (priv->con_ip6_config, priv->ext_ip6_config); Instead if @con_ip6_config is cleared it will be rebuilt from the connection setting at the next commit. Fixes-test: @ipv6_preserve_cached_routes --- src/devices/nm-device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index d4193384b..2b093ea96 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -7421,8 +7421,10 @@ addrconf6_start_with_link_ready (NMDevice *self) } /* Apply any manual configuration before starting RA */ - if (!ip6_config_merge_and_apply (self, TRUE)) + if (!ip6_config_merge_and_apply (self, TRUE)) { _LOGW (LOGD_IP6, "failed to apply manual IPv6 configuration"); + g_clear_object (&priv->con_ip6_config); + } /* XXX: These sysctls would probably be better set by the lndp ndisc itself. */ switch (nm_ndisc_get_node_type (priv->ndisc)) {