diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2019-06-25 09:51:22 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2019-06-25 10:35:37 +0200 |
commit | b942e0ac9a8aa39c7b80c330e93f3294ee0a8539 (patch) | |
tree | 096ebfd7905ff08b28356575c80e9aa55f7b07dd | |
parent | 1ed338fe5e92870005b251788be04ee05a14f3b4 (diff) | |
download | NetworkManager-bg/ipv6-token.tar.gz |
device: set IPv6 token only when necessarybg/ipv6-token
Setting the IPv6 token triggers a new router solicitation from kernel
and so we should avoid when not strictly necessary.
https://mail.gnome.org/archives/networkmanager-list/2019-May/msg00004.html
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/179
-rw-r--r-- | src/devices/nm-device.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 334912b058..8fe3e5776f 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -7566,15 +7566,23 @@ ip_config_merge_and_apply (NMDevice *self, } if (!IS_IPv4) { + const NMPlatformLink *link; NMUtilsIPv6IfaceId iid; + NMPlatform *platform; + int ifindex; if ( commit && priv->ndisc_started && ip6_addr_gen_token && nm_utils_ipv6_interface_identifier_get_from_token (&iid, ip6_addr_gen_token)) { - nm_platform_link_set_ipv6_token (nm_device_get_platform (self), - nm_device_get_ip_ifindex (self), - iid); + platform = nm_device_get_platform (self); + ifindex = nm_device_get_ip_ifindex (self); + link = nm_platform_link_get (platform, ifindex); + + if (link && link->inet6_token.id == iid.id) + _LOGT (LOGD_DEVICE | LOGD_IP6, "token %s already set", ip6_addr_gen_token); + else + nm_platform_link_set_ipv6_token (platform, ifindex, iid); } } |