diff options
author | Thomas Haller <thaller@redhat.com> | 2018-02-09 20:48:11 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-02-09 21:07:57 +0100 |
commit | 3e9e51f1dda8b142f63fa9eace77e02208fb5113 (patch) | |
tree | 6793867c67835b8d9534693e218ad07fa922371a /src/nm-ip6-config.c | |
parent | fa41e5852cebb3ba5f6dde880ef792d361cc7fe9 (diff) | |
download | NetworkManager-3e9e51f1dda8b142f63fa9eace77e02208fb5113.tar.gz |
core: distinguish between IFA_F_SECONDARY and IFA_F_TEMPORARY
While the numerical values of IFA_F_SECONDARY and IFA_F_TEMPORARY
are identical, their meaning is not.
IFA_F_SECONDARY is only relevant for IPv4 addresses, while
IFA_F_TEMPORARY is only relevant for IPv6 addresses.
IFA_F_TEMPORARY is automatically set by kernel for the addresses
that it generates as part of IFA_F_MANAGETEMPADDR. It cannot be
actively set by user-space.
IFA_F_SECONDARY is automatically set by kernel depending on the order
in which the addresses for the same subnet are added.
This essentially reverts 8b4f11927 (core: avoid IFA_F_TEMPORARY alias for
IFA_F_SECONDARY).
Diffstat (limited to 'src/nm-ip6-config.c')
-rw-r--r-- | src/nm-ip6-config.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index 3fb1c8675a..8d2d9471a4 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -268,19 +268,19 @@ _addresses_sort_cmp (const NMPlatformIP6Address *a1, if (p1 != p2) return p1 > p2 ? -1 : 1; - ipv6_privacy1 = !!(a1->n_ifa_flags & (IFA_F_MANAGETEMPADDR | IFA_F_SECONDARY)); - ipv6_privacy2 = !!(a2->n_ifa_flags & (IFA_F_MANAGETEMPADDR | IFA_F_SECONDARY)); + ipv6_privacy1 = !!(a1->n_ifa_flags & (IFA_F_MANAGETEMPADDR | IFA_F_TEMPORARY)); + ipv6_privacy2 = !!(a2->n_ifa_flags & (IFA_F_MANAGETEMPADDR | IFA_F_TEMPORARY)); if (ipv6_privacy1 || ipv6_privacy2) { gboolean public1 = TRUE, public2 = TRUE; if (ipv6_privacy1) { - if (a1->n_ifa_flags & IFA_F_SECONDARY) + if (a1->n_ifa_flags & IFA_F_TEMPORARY) public1 = prefer_temp; else public1 = !prefer_temp; } if (ipv6_privacy2) { - if (a2->n_ifa_flags & IFA_F_SECONDARY) + if (a2->n_ifa_flags & IFA_F_TEMPORARY) public2 = prefer_temp; else public2 = !prefer_temp; |