parent
6daa59f8f1
commit
e7a0aa413a
@ -0,0 +1,42 @@
|
|||||||
|
From 72fc1ef4c365cfda7fc0a86afd3ce124d57e8d5c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Wen Liang <liangwen12year@gmail.com>
|
||||||
|
Date: Mon, 17 Jul 2023 14:09:04 -0400
|
||||||
|
Subject: [PATCH] assume: change IPv6 method from "ignore" and "disabled" into
|
||||||
|
"auto"
|
||||||
|
|
||||||
|
IPv6 method "disabled" and "ignore" are not supported for loopback
|
||||||
|
device, when generating the assume connection, the generated connection
|
||||||
|
will fail verification. Therefore, change the IPv6 method into "auto",
|
||||||
|
as a result, for loopback external connection, NM will not toggle the
|
||||||
|
`disable_ipv6` sysctl setting when `systemd-sysctl` sets it into 1.
|
||||||
|
|
||||||
|
https://bugzilla.redhat.com/show_bug.cgi?id=2207878
|
||||||
|
|
||||||
|
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1694
|
||||||
|
(cherry picked from commit e8a2306afbcd3e328f62004af92cd21b2477f0ac)
|
||||||
|
(cherry picked from commit 832e8df0c17f44be2c62485c19a0b20f6d3efa07)
|
||||||
|
---
|
||||||
|
src/core/NetworkManagerUtils.c | 7 +++++++
|
||||||
|
1 file changed, 7 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/core/NetworkManagerUtils.c b/src/core/NetworkManagerUtils.c
|
||||||
|
index 6f4c60f876..84ee6c3a0d 100644
|
||||||
|
--- a/src/core/NetworkManagerUtils.c
|
||||||
|
+++ b/src/core/NetworkManagerUtils.c
|
||||||
|
@@ -1748,6 +1748,13 @@ nm_utils_platform_capture_ip_setting(NMPlatform *platform,
|
||||||
|
method = maybe_ipv6_disabled ? NM_SETTING_IP6_CONFIG_METHOD_DISABLED
|
||||||
|
: NM_SETTING_IP6_CONFIG_METHOD_IGNORE;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ /* The IPv6 method "ignore" and "disabled" are not supported for loopback */
|
||||||
|
+ if (ifindex == 1
|
||||||
|
+ && NM_IN_STRSET(method,
|
||||||
|
+ NM_SETTING_IP6_CONFIG_METHOD_DISABLED,
|
||||||
|
+ NM_SETTING_IP6_CONFIG_METHOD_IGNORE))
|
||||||
|
+ method = NM_SETTING_IP6_CONFIG_METHOD_AUTO;
|
||||||
|
g_object_set(s_ip, NM_SETTING_IP_CONFIG_METHOD, method, NULL);
|
||||||
|
|
||||||
|
nmp_lookup_init_object_by_ifindex(&lookup, NMP_OBJECT_TYPE_IP_ROUTE(IS_IPv4), ifindex);
|
||||||
|
--
|
||||||
|
2.41.0
|
||||||
|
|
@ -0,0 +1,89 @@
|
|||||||
|
From 895ed1ef14c49a94fb665e519bad409adf53c80f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Beniamino Galvani <bgalvani@redhat.com>
|
||||||
|
Date: Mon, 27 Feb 2023 09:10:34 +0100
|
||||||
|
Subject: [PATCH] settings: preserve existing connection flags on update
|
||||||
|
|
||||||
|
We are passing to the plugin only 'sett_flags', which is the bitmask
|
||||||
|
of flags to change and works together with 'sett_mask'; however,
|
||||||
|
plugins interpret that value as the new flags value. The result is
|
||||||
|
that if there is no change needed (0/0), the existing flags are lost.
|
||||||
|
Simple reproducer:
|
||||||
|
|
||||||
|
ip link add dummy1 type dummy
|
||||||
|
ip link set dummy1 up
|
||||||
|
ip addr add dev dummy1 fd01::12/64
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
# now, a external connection is created by NM
|
||||||
|
|
||||||
|
echo "BEFORE:"
|
||||||
|
cat /run/NetworkManager/system-connections/dummy1.nmconnection | grep "nm-generated\|volatile\|external"
|
||||||
|
|
||||||
|
# just add a new address to the interface to make it lose
|
||||||
|
# the external flag
|
||||||
|
|
||||||
|
ip addr add dev dummy1 172.25.42.1/24
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
echo "AFTER:"
|
||||||
|
cat /run/NetworkManager/system-connections/dummy1.nmconnection | grep "nm-generated\|volatile\|external"
|
||||||
|
|
||||||
|
Output:
|
||||||
|
|
||||||
|
BEFORE:
|
||||||
|
nm-generated=true
|
||||||
|
volatile=true
|
||||||
|
external=true
|
||||||
|
AFTER:
|
||||||
|
|
||||||
|
Fixes: d35d3c468a30 ('settings: rework tracking settings connections and settings plugins')
|
||||||
|
|
||||||
|
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1548
|
||||||
|
(cherry picked from commit 86b922695f18566132980bd23516038b6ca4c0f4)
|
||||||
|
(cherry picked from commit 4353f842303d0d905c92e8e497e22f8440261381)
|
||||||
|
---
|
||||||
|
src/core/settings/nm-settings.c | 8 ++++++--
|
||||||
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/core/settings/nm-settings.c b/src/core/settings/nm-settings.c
|
||||||
|
index 63476c3c94..9995b490d2 100644
|
||||||
|
--- a/src/core/settings/nm-settings.c
|
||||||
|
+++ b/src/core/settings/nm-settings.c
|
||||||
|
@@ -2009,6 +2009,7 @@ nm_settings_update_connection(NMSettings *self,
|
||||||
|
const char *uuid;
|
||||||
|
gboolean tombstone_in_memory = FALSE;
|
||||||
|
gboolean tombstone_on_disk = FALSE;
|
||||||
|
+ NMSettingsConnectionIntFlags new_flags;
|
||||||
|
|
||||||
|
g_return_val_if_fail(NM_IS_SETTINGS(self), FALSE);
|
||||||
|
g_return_val_if_fail(NM_IS_SETTINGS_CONNECTION(sett_conn), FALSE);
|
||||||
|
@@ -2228,13 +2229,16 @@ nm_settings_update_connection(NMSettings *self,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ new_flags = nm_settings_connection_get_flags(sett_conn);
|
||||||
|
+ new_flags = NM_FLAGS_ASSIGN_MASK(new_flags, sett_mask, sett_flags);
|
||||||
|
+
|
||||||
|
if (!update_storage) {
|
||||||
|
success = _add_connection_to_first_plugin(self,
|
||||||
|
plugin_name,
|
||||||
|
sett_conn_entry,
|
||||||
|
connection,
|
||||||
|
new_in_memory,
|
||||||
|
- sett_flags,
|
||||||
|
+ new_flags,
|
||||||
|
new_shadowed_storage_filename,
|
||||||
|
new_shadowed_owned,
|
||||||
|
&new_storage,
|
||||||
|
@@ -2245,7 +2249,7 @@ nm_settings_update_connection(NMSettings *self,
|
||||||
|
success = _update_connection_to_plugin(self,
|
||||||
|
update_storage,
|
||||||
|
connection,
|
||||||
|
- sett_flags,
|
||||||
|
+ new_flags,
|
||||||
|
update_reason,
|
||||||
|
new_shadowed_storage_filename,
|
||||||
|
new_shadowed_owned,
|
||||||
|
--
|
||||||
|
2.41.0
|
||||||
|
|
Loading…
Reference in new issue