mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 12:50:09 +01:00
device: set IPv6 token only when necessary
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
(cherry picked from commit e4ce9bd7af)
This commit is contained in:
parent
52c886a6d7
commit
7f239eff44
1 changed files with 11 additions and 3 deletions
|
|
@ -7413,15 +7413,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue