diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2024-03-28 10:25:06 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2024-03-28 19:21:43 +0100 |
commit | f58b281ef4b62cfb1910743f7fdaa7fa8d14b638 (patch) | |
tree | 8c51cbc44595f1ba79c7dfc8b1e4277f9ae76cee | |
parent | b4e30955221f0dc48df14a38499f5002a11424cb (diff) |
ndisc: accept unknown ip6-privacy valuebg/ip6-privacy-ndisc
The value can be unknown for different reasons:
- we don't have a value saved in NMDevice's "ip6_saved_properties"
because NM was restarted or because the device didn't have an
ifindex when it became managed.
- the value read from /proc is outside the allowed range (kernel
allows "echo 42 > /proc/sys/net/ipv6/conf/enp1s0/use_tempaddr")
Note that the second case was already possible before commit
797f3cafeece ('device: fall back to saved use_tempaddr value instead
of rereading /proc').
If we can't determine the previous value, pass "unknown" to ndisc; it
will generate a l3cd with "unknown" ip6-privacy, which means to not
set the value when committing the configuration.
Fixes: 797f3cafeece ('device: fall back to saved use_tempaddr value instead of rereading /proc')
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1907
-rw-r--r-- | src/core/ndisc/nm-ndisc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/ndisc/nm-ndisc.c b/src/core/ndisc/nm-ndisc.c index e6b1a94ea0..ca646a6dad 100644 --- a/src/core/ndisc/nm-ndisc.c +++ b/src/core/ndisc/nm-ndisc.c @@ -1853,6 +1853,7 @@ _config_init(NMNDiscConfig *config, const NMNDiscConfig *src) g_return_if_fail( NM_IN_SET(config->node_type, NM_NDISC_NODE_TYPE_HOST, NM_NDISC_NODE_TYPE_ROUTER)); g_return_if_fail(NM_IN_SET(config->ip6_privacy, + NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN, NM_SETTING_IP6_CONFIG_PRIVACY_DISABLED, NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_PUBLIC_ADDR, NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR)); |