diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2019-10-17 10:03:55 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2019-10-23 17:44:38 +0200 |
commit | 3eb2f435ae4763ca1b8c9afc46642e2d6a4b31e1 (patch) | |
tree | 0a43f59f85098f3e75a0bdec1444dffac57b44b3 /src/nm-ip6-config.c | |
parent | 01920d3d523795c6f2917007bbf471ac28603371 (diff) | |
download | NetworkManager-3eb2f435ae4763ca1b8c9afc46642e2d6a4b31e1.tar.gz |
core: track whether IP addresses are external
Track whether IP addresses were added by NM or externally. In this way
it becomes possible in a later commit to add prefix route only for
addresses added by NM.
Diffstat (limited to 'src/nm-ip6-config.c')
-rw-r--r-- | src/nm-ip6-config.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index e109e42acf..8ed17b95f6 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -849,8 +849,17 @@ nm_ip6_config_merge (NMIP6Config *dst, g_object_freeze_notify (G_OBJECT (dst)); /* addresses */ - nm_ip_config_iter_ip6_address_for_each (&ipconf_iter, src, &address) - _add_address (dst, NMP_OBJECT_UP_CAST (address), NULL); + nm_ip_config_iter_ip6_address_for_each (&ipconf_iter, src, &address) { + if ( NM_FLAGS_HAS (merge_flags, NM_IP_CONFIG_MERGE_EXTERNAL) + && !address->external) { + NMPlatformIP6Address a; + + a = *address; + a.external = TRUE; + _add_address (dst, NULL, &a); + } else + _add_address (dst, NMP_OBJECT_UP_CAST (address), NULL); + } /* nameservers */ if (!NM_FLAGS_HAS (merge_flags, NM_IP_CONFIG_MERGE_NO_DNS)) { |