From ee4cb526d6b77522788b3f95634c71607ba8bb3a Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 27 Sep 2022 10:47:36 -0400 Subject: [PATCH] import NetworkManager-1.39.90-1.el9 --- .NetworkManager.metadata | 2 +- .gitignore | 2 +- SOURCES/1001-wwan-dns-fix-rh2059138.patch | 62 ---- ...erve-external-bridge-ports-rh2035519.patch | 332 ------------------ ...-fix-ovsdb-removal-ports-rhbz1935026.patch | 52 --- SOURCES/readme-ifcfg-rh.txt | 31 ++ SPECS/NetworkManager.spec | 204 ++++++++--- 7 files changed, 194 insertions(+), 491 deletions(-) delete mode 100644 SOURCES/1001-wwan-dns-fix-rh2059138.patch delete mode 100644 SOURCES/1002-checkpoint-preserve-external-bridge-ports-rh2035519.patch delete mode 100644 SOURCES/1003-fix-ovsdb-removal-ports-rhbz1935026.patch create mode 100644 SOURCES/readme-ifcfg-rh.txt diff --git a/.NetworkManager.metadata b/.NetworkManager.metadata index 95d4404..2f0085e 100644 --- a/.NetworkManager.metadata +++ b/.NetworkManager.metadata @@ -1 +1 @@ -adbe8e9eef649ac73c4fbaefd71a1335d4d016cd SOURCES/NetworkManager-1.36.0.tar.xz +bdfa8c04223ec176d348062f5843353fb82c0704 SOURCES/NetworkManager-1.39.90.tar.xz diff --git a/.gitignore b/.gitignore index db48e32..3482316 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/NetworkManager-1.36.0.tar.xz +SOURCES/NetworkManager-1.39.90.tar.xz diff --git a/SOURCES/1001-wwan-dns-fix-rh2059138.patch b/SOURCES/1001-wwan-dns-fix-rh2059138.patch deleted file mode 100644 index fbfcf88..0000000 --- a/SOURCES/1001-wwan-dns-fix-rh2059138.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 7ba52fdcfeeb1e5400bcecb9fa93b3099dcccb47 Mon Sep 17 00:00:00 2001 -From: Beniamino Galvani -Date: Fri, 25 Feb 2022 10:06:48 +0100 -Subject: [PATCH] core: initialize l3cd dns-priority for ppp and wwan - -For devices that configure IP by themselves (by returning -"->ready_for_ip_config() = TRUE" and implementing -->act_stage3_ip_config()), we skip manual configuration. Currently, -manual configuration is the only one that sets flag HAS_DNS_PRIORITY -into the resulting l3cd. - -So, the merged l3cd for such devices misses a dns-priority and is -ignored by the DNS manager. - -Explicitly initialize the priority to 0; in this way, the default -value for the device will be set in the final l3cd during the merge. - -Fixes: 58287cbcc0c8 ('core: rework IP configuration in NetworkManager using layer 3 configuration') - -https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/931 -(cherry picked from commit b2e559fab2fa5adbf4e159fc1c2cadd3d965b01b) -(cherry picked from commit bfd3216584e9fe1eb0b6f3f81e3eb75a40877775) ---- - src/core/devices/wwan/nm-modem-broadband.c | 2 ++ - src/core/ppp/nm-ppp-manager.c | 1 + - 2 files changed, 3 insertions(+) - -diff --git a/src/core/devices/wwan/nm-modem-broadband.c b/src/core/devices/wwan/nm-modem-broadband.c -index f5336d3750..b585652e5d 100644 ---- a/src/core/devices/wwan/nm-modem-broadband.c -+++ b/src/core/devices/wwan/nm-modem-broadband.c -@@ -1032,6 +1032,7 @@ stage3_ip_config_start(NMModem *modem, int addr_family, NMModemIPMethod ip_metho - l3cd = nm_l3_config_data_new(nm_platform_get_multi_idx(NM_PLATFORM_GET), - ifindex, - NM_IP_CONFIG_SOURCE_WWAN); -+ nm_l3_config_data_set_dns_priority(l3cd, AF_INET, 0); - - address = (NMPlatformIP4Address){ - .address = address_network, -@@ -1118,6 +1119,7 @@ stage3_ip_config_start(NMModem *modem, int addr_family, NMModemIPMethod ip_metho - l3cd = nm_l3_config_data_new(nm_platform_get_multi_idx(NM_PLATFORM_GET), - ifindex, - NM_IP_CONFIG_SOURCE_WWAN); -+ nm_l3_config_data_set_dns_priority(l3cd, AF_INET6, 0); - - do_auto = TRUE; - -diff --git a/src/core/ppp/nm-ppp-manager.c b/src/core/ppp/nm-ppp-manager.c -index dd6b1bc7f0..5761d59d39 100644 ---- a/src/core/ppp/nm-ppp-manager.c -+++ b/src/core/ppp/nm-ppp-manager.c -@@ -545,6 +545,7 @@ impl_ppp_manager_set_ip4_config(NMDBusObject *obj, - NM_IP_CONFIG_SOURCE_PPP); - - nm_l3_config_data_set_mtu(l3cd, mtu); -+ nm_l3_config_data_set_dns_priority(l3cd, AF_INET, 0); - - address = (NMPlatformIP4Address){ - .plen = 32, --- -2.34.1 - diff --git a/SOURCES/1002-checkpoint-preserve-external-bridge-ports-rh2035519.patch b/SOURCES/1002-checkpoint-preserve-external-bridge-ports-rh2035519.patch deleted file mode 100644 index 5d5d9c4..0000000 --- a/SOURCES/1002-checkpoint-preserve-external-bridge-ports-rh2035519.patch +++ /dev/null @@ -1,332 +0,0 @@ -From b55842ac0803b59fe8675464191180e44634ce1f Mon Sep 17 00:00:00 2001 -From: Thomas Haller -Date: Tue, 22 Feb 2022 22:08:18 +0100 -Subject: [PATCH 1/2] core: reject unsupported flags for CheckpointCreate D-Bus - request - -(cherry picked from commit df6ee44fb2b96cf05aaeeee500c75d7d91b37404) -(cherry picked from commit 4cfc2245d382b0b869bd52238eecd17f1c10af1c) ---- - src/core/nm-manager.c | 34 +++++++++++++++++++++++++--------- - 1 file changed, 25 insertions(+), 9 deletions(-) - -diff --git a/src/core/nm-manager.c b/src/core/nm-manager.c -index b440b22457f2..53ef1754bb72 100644 ---- a/src/core/nm-manager.c -+++ b/src/core/nm-manager.c -@@ -7453,15 +7453,30 @@ impl_manager_checkpoint_create(NMDBusObject *obj, - GDBusMethodInvocation *invocation, - GVariant *parameters) - { -- NMManager *self = NM_MANAGER(obj); -- NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE(self); -- NMAuthChain *chain; -- char **devices; -- guint32 rollback_timeout; -- guint32 flags; -+ NMManager *self = NM_MANAGER(obj); -+ NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE(self); -+ NMAuthChain *chain; -+ gs_strfreev char **devices = NULL; -+ guint32 rollback_timeout; -+ guint32 flags; - - G_STATIC_ASSERT_EXPR(sizeof(flags) <= sizeof(NMCheckpointCreateFlags)); - -+ g_variant_get(parameters, "(^aouu)", &devices, &rollback_timeout, &flags); -+ -+ if ((NMCheckpointCreateFlags) flags != flags -+ || NM_FLAGS_ANY(flags, -+ ~((guint32) (NM_CHECKPOINT_CREATE_FLAG_DESTROY_ALL -+ | NM_CHECKPOINT_CREATE_FLAG_DELETE_NEW_CONNECTIONS -+ | NM_CHECKPOINT_CREATE_FLAG_DISCONNECT_NEW_DEVICES -+ | NM_CHECKPOINT_CREATE_FLAG_ALLOW_OVERLAPPING)))) { -+ g_dbus_method_invocation_return_error_literal(invocation, -+ NM_MANAGER_ERROR, -+ NM_MANAGER_ERROR_INVALID_ARGUMENTS, -+ "Invalid flags"); -+ return; -+ } -+ - chain = nm_auth_chain_new_context(invocation, checkpoint_auth_done_cb, self); - if (!chain) { - g_dbus_method_invocation_return_error_literal(invocation, -@@ -7471,11 +7486,12 @@ impl_manager_checkpoint_create(NMDBusObject *obj, - return; - } - -- g_variant_get(parameters, "(^aouu)", &devices, &rollback_timeout, &flags); -- - c_list_link_tail(&priv->auth_lst_head, nm_auth_chain_parent_lst_list(chain)); - nm_auth_chain_set_data(chain, "audit-op", NM_AUDIT_OP_CHECKPOINT_CREATE, NULL); -- nm_auth_chain_set_data(chain, "devices", devices, (GDestroyNotify) g_strfreev); -+ nm_auth_chain_set_data(chain, -+ "devices", -+ g_steal_pointer(&devices), -+ (GDestroyNotify) g_strfreev); - nm_auth_chain_set_data(chain, "flags", GUINT_TO_POINTER(flags), NULL); - nm_auth_chain_set_data(chain, "timeout", GUINT_TO_POINTER(rollback_timeout), NULL); - nm_auth_chain_add_call(chain, NM_AUTH_PERMISSION_CHECKPOINT_ROLLBACK, TRUE); --- -2.35.1 - - -From 3c417c8338bf44292d4869763587286c7d492c0c Mon Sep 17 00:00:00 2001 -From: Thomas Haller -Date: Tue, 22 Feb 2022 21:55:57 +0100 -Subject: [PATCH 2/2] core: preserve external ports during checkpoint rollback - -When we have a bridge interface with ports attached externally (that is, -not by NetworkManager itself), then it can make sense that during -checkpoint rollback we want to keep those ports attached. - -During rollback, we may need to deactivate the bridge device and -re-activate it. Implement this, by setting a flag before deactivating, -which prevents external ports to be detached. The flag gets cleared, -when the device state changes to activated (the following activation) -or unmanaged. - -This is an ugly solution, for several reasons. - -For one, NMDevice tracks its ports in the "slaves" list. But what -it does is ugly. There is no clear concept to understand what it -actually tacks. For example, it tracks externally added interfaces -(nm_device_sys_iface_state_is_external()) that are attached while -not being connected. But it also tracks interfaces that we want to attach -during activation (but which are not yet actually enslaved). It also tracks -slaves that have no actual netdev device (OVS). So it's not clear what this -list contains and what it should contain at any point in time. When we skip -the change of the slaves states during nm_device_master_release_slaves_all(), -it's not really clear what the effects are. It's ugly, but probably correct -enough. What would be better, if we had a clear purpose of what the -lists (or several lists) mean. E.g. a list of all ports that are -currently, physically attached vs. a list of ports we want to attach vs. -a list of OVS slaves that have no actual netdev device. - -Another problem is that we attach state on the device -("activation_state_preserve_external_ports"), which should linger there -during the deactivation and reactivation. How can we be sure that we don't -leave that flag dangling there, and that the desired following activation -is the one we cared about? If the follow-up activation fails short (e.g. an -unmanaged command comes first), will we properly disconnect the slaves? -Should we even? In practice, it might be correct enough. - -Also, we only implement this for bridges. I think this is where it makes -the most sense. And after all, it's an odd thing to preserve unknown, -external things during a rollback -- unknown, because we have no knowledge -about why these ports are attached and what to do with them. - -Also, the change doesn't remember the ports that were attached when the -checkpoint was created. Instead, we preserve all ports that are attached -during rollback. That seems more useful and easier to implement. So we -don't actually rollback to the configuration when the checkpoint was -created. Instead, we rollback, but keep external devices. - -Also, we do this now by default and introduce a flag to get the previous -behavior. - -https://bugzilla.redhat.com/show_bug.cgi?id=2035519 -https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/ # 909 -(cherry picked from commit 98b3056604fc565f273c264b892086a75a4db0e9) -(cherry picked from commit 351ca13358f62f85af675672c3399141bec092cd) ---- - src/core/devices/nm-device.c | 71 ++++++++++++++++++++++- - src/core/devices/nm-device.h | 2 + - src/core/nm-checkpoint.c | 5 ++ - src/core/nm-manager.c | 3 +- - src/libnm-core-public/nm-dbus-interface.h | 16 +++-- - 5 files changed, 90 insertions(+), 7 deletions(-) - -diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c -index 35360ceebb7b..a11486d54be3 100644 ---- a/src/core/devices/nm-device.c -+++ b/src/core/devices/nm-device.c -@@ -76,6 +76,7 @@ - #include "nm-hostname-manager.h" - - #include "nm-device-generic.h" -+#include "nm-device-bridge.h" - #include "nm-device-vlan.h" - #include "nm-device-vrf.h" - #include "nm-device-wireguard.h" -@@ -483,9 +484,12 @@ typedef struct _NMDevicePrivate { - - NMUtilsStableType current_stable_id_type : 3; - -+ bool activation_state_preserve_external_ports : 1; -+ - bool nm_owned : 1; /* whether the device is a device owned and created by NM */ - -- bool assume_state_guess_assume : 1; -+ bool assume_state_guess_assume : 1; -+ - char *assume_state_connection_uuid; - - guint64 udi_id; -@@ -7666,8 +7670,19 @@ nm_device_master_release_slaves(NMDevice *self) - c_list_for_each_safe (iter, safe, &priv->slaves) { - SlaveInfo *info = c_list_entry(iter, SlaveInfo, lst_slave); - -+ if (priv->activation_state_preserve_external_ports -+ && nm_device_sys_iface_state_is_external(info->slave)) { -+ _LOGT(LOGD_DEVICE, -+ "master: preserve external port %s", -+ nm_device_get_iface(info->slave)); -+ continue; -+ } - nm_device_master_release_one_slave(self, info->slave, TRUE, FALSE, reason); - } -+ -+ /* We only need this flag for a short time. It served its purpose. Clear -+ * it again. */ -+ nm_device_activation_state_set_preserve_external_ports(self, FALSE); - } - - /** -@@ -15386,6 +15401,16 @@ _set_state_full(NMDevice *self, NMDeviceState state, NMDeviceStateReason reason, - if (state > NM_DEVICE_STATE_DISCONNECTED) - nm_device_assume_state_reset(self); - -+ if (state < NM_DEVICE_STATE_UNAVAILABLE -+ || (state >= NM_DEVICE_STATE_IP_CONFIG && state < NM_DEVICE_STATE_ACTIVATED)) { -+ /* preserve-external-ports is used by NMCheckpoint to activate a master -+ * device, and preserve already attached ports. This means, this state is only -+ * relevant during the deactivation and the following activation of the -+ * right profile. Once we are sufficiently far in the activation of the -+ * intended profile, we clear the state again. */ -+ nm_device_activation_state_set_preserve_external_ports(self, FALSE); -+ } -+ - if (state <= NM_DEVICE_STATE_UNAVAILABLE) { - if (available_connections_del_all(self)) - _notify(self, PROP_AVAILABLE_CONNECTIONS); -@@ -15790,6 +15815,50 @@ nm_device_get_state(NMDevice *self) - return NM_DEVICE_GET_PRIVATE(self)->state; - } - -+/*****************************************************************************/ -+ -+/** -+ * nm_device_activation_state_set_preserve_external_ports: -+ * @self: the NMDevice. -+ * @flag: whether to set or clear the the flag. -+ * -+ * This sets an internal flag to true, which does something specific. -+ * For non-master devices, it has no effect. For master devices, this -+ * will prevent to detach all external ports, until the next activation -+ * completes. -+ * -+ * This is used during checkpoint/rollback. We may want to preserve -+ * externally attached ports during the restore. NMCheckpoint will -+ * call this before doing a re-activation. By setting the flag, -+ * we basically preserve such ports. -+ * -+ * Once we reach again ACTIVATED state, the flag gets cleared. This -+ * only has effect for the next activation cycle. */ -+void -+nm_device_activation_state_set_preserve_external_ports(NMDevice *self, gboolean flag) -+{ -+ NMDevicePrivate *priv; -+ -+ g_return_if_fail(NM_IS_DEVICE(self)); -+ -+ priv = NM_DEVICE_GET_PRIVATE(self); -+ -+ if (!NM_IS_DEVICE_BRIDGE(self)) { -+ /* This is actually only implemented for bridge devices. While it might -+ * make sense for bond/team or OVS, it's not clear that it is actually -+ * useful or desirable. */ -+ return; -+ } -+ -+ if (priv->activation_state_preserve_external_ports == flag) -+ return; -+ -+ priv->activation_state_preserve_external_ports = flag; -+ _LOGD(LOGD_DEVICE, -+ "activation-state: preserve-external-ports %s", -+ flag ? "enabled" : "disabled"); -+} -+ - /*****************************************************************************/ - /* NMConfigDevice interface related stuff */ - -diff --git a/src/core/devices/nm-device.h b/src/core/devices/nm-device.h -index cfcd4ade6d80..a7badb861087 100644 ---- a/src/core/devices/nm-device.h -+++ b/src/core/devices/nm-device.h -@@ -444,6 +444,8 @@ NMDeviceType nm_device_get_device_type(NMDevice *dev); - NMLinkType nm_device_get_link_type(NMDevice *dev); - NMMetered nm_device_get_metered(NMDevice *dev); - -+void nm_device_activation_state_set_preserve_external_ports(NMDevice *self, gboolean flag); -+ - guint32 nm_device_get_route_table(NMDevice *self, int addr_family); - guint32 nm_device_get_route_metric(NMDevice *dev, int addr_family); - -diff --git a/src/core/nm-checkpoint.c b/src/core/nm-checkpoint.c -index 0153af970de7..5b48f91aa515 100644 ---- a/src/core/nm-checkpoint.c -+++ b/src/core/nm-checkpoint.c -@@ -282,6 +282,11 @@ restore_and_activate_connection(NMCheckpoint *self, DeviceCheckpoint *dev_checkp - * an internal subject. */ - if (nm_device_get_state(dev_checkpoint->device) > NM_DEVICE_STATE_DISCONNECTED - && nm_device_get_state(dev_checkpoint->device) < NM_DEVICE_STATE_DEACTIVATING) { -+ if (!NM_FLAGS_HAS(priv->flags, NM_CHECKPOINT_CREATE_FLAG_NO_PRESERVE_EXTERNAL_PORTS)) { -+ nm_device_activation_state_set_preserve_external_ports(dev_checkpoint->device, -+ TRUE); -+ } -+ - nm_device_state_changed(dev_checkpoint->device, - NM_DEVICE_STATE_DEACTIVATING, - NM_DEVICE_STATE_REASON_NEW_ACTIVATION); -diff --git a/src/core/nm-manager.c b/src/core/nm-manager.c -index 53ef1754bb72..6c73d237c845 100644 ---- a/src/core/nm-manager.c -+++ b/src/core/nm-manager.c -@@ -7469,7 +7469,8 @@ impl_manager_checkpoint_create(NMDBusObject *obj, - ~((guint32) (NM_CHECKPOINT_CREATE_FLAG_DESTROY_ALL - | NM_CHECKPOINT_CREATE_FLAG_DELETE_NEW_CONNECTIONS - | NM_CHECKPOINT_CREATE_FLAG_DISCONNECT_NEW_DEVICES -- | NM_CHECKPOINT_CREATE_FLAG_ALLOW_OVERLAPPING)))) { -+ | NM_CHECKPOINT_CREATE_FLAG_ALLOW_OVERLAPPING -+ | NM_CHECKPOINT_CREATE_FLAG_NO_PRESERVE_EXTERNAL_PORTS)))) { - g_dbus_method_invocation_return_error_literal(invocation, - NM_MANAGER_ERROR, - NM_MANAGER_ERROR_INVALID_ARGUMENTS, -diff --git a/src/libnm-core-public/nm-dbus-interface.h b/src/libnm-core-public/nm-dbus-interface.h -index fe2a6c09db58..0d23c7d7a793 100644 ---- a/src/libnm-core-public/nm-dbus-interface.h -+++ b/src/libnm-core-public/nm-dbus-interface.h -@@ -959,17 +959,23 @@ typedef enum { - * overlapping younger checkpoints. This opts-in that the - * checkpoint can be automatically destroyed by the rollback - * of an older checkpoint. Since: 1.12. -+ * @NM_CHECKPOINT_CREATE_FLAG_NO_PRESERVE_EXTERNAL_PORTS: during rollback, -+ * by default externally added ports attached to bridge devices are preserved. -+ * With this flag, the rollback detaches all external ports. -+ * This only has an effect for bridge ports. Before 1.38, 1.36.2, this was the default -+ * behavior. Since: 1.38, 1.36.2. - * - * The flags for CheckpointCreate call - * - * Since: 1.4 (gi flags generated since 1.12) - */ - typedef enum { /*< flags >*/ -- NM_CHECKPOINT_CREATE_FLAG_NONE = 0, -- NM_CHECKPOINT_CREATE_FLAG_DESTROY_ALL = 0x01, -- NM_CHECKPOINT_CREATE_FLAG_DELETE_NEW_CONNECTIONS = 0x02, -- NM_CHECKPOINT_CREATE_FLAG_DISCONNECT_NEW_DEVICES = 0x04, -- NM_CHECKPOINT_CREATE_FLAG_ALLOW_OVERLAPPING = 0x08, -+ NM_CHECKPOINT_CREATE_FLAG_NONE = 0, -+ NM_CHECKPOINT_CREATE_FLAG_DESTROY_ALL = 0x01, -+ NM_CHECKPOINT_CREATE_FLAG_DELETE_NEW_CONNECTIONS = 0x02, -+ NM_CHECKPOINT_CREATE_FLAG_DISCONNECT_NEW_DEVICES = 0x04, -+ NM_CHECKPOINT_CREATE_FLAG_ALLOW_OVERLAPPING = 0x08, -+ NM_CHECKPOINT_CREATE_FLAG_NO_PRESERVE_EXTERNAL_PORTS = 0x10, - } NMCheckpointCreateFlags; - - /** --- -2.35.1 - diff --git a/SOURCES/1003-fix-ovsdb-removal-ports-rhbz1935026.patch b/SOURCES/1003-fix-ovsdb-removal-ports-rhbz1935026.patch deleted file mode 100644 index 30821d5..0000000 --- a/SOURCES/1003-fix-ovsdb-removal-ports-rhbz1935026.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 482f9671c69800de2077d2dab9352a9b385115d3 Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Tue, 22 Feb 2022 16:18:40 +0100 -Subject: [PATCH] ovs-port: fix removal of ovsdb entry if the interface goes - away - -Hope third time is the charm. - -The idea here is to remove the OVSDB entry if the device actually went away -violently (like, the it was actually removed from the platform), but keep it if -we're shutting down. - -Fixes-test: @ovs_nmstate -Fixes: 966413e78f14 ('ovs-port: avoid removing the OVSDB entry if we're shutting down') -Fixes: ecc73eb239e6 ('ovs-port: always remove the OVSDB entry on slave release') - -https://bugzilla.redhat.com/show_bug.cgi?id=2055665 -(cherry picked from commit 65fdfb25006acc3c67059792579dd7a770d04768) -(cherry picked from commit fee7328c86e5fe8171f8382492f147e7d263891b) ---- - src/core/devices/ovs/nm-device-ovs-port.c | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/src/core/devices/ovs/nm-device-ovs-port.c b/src/core/devices/ovs/nm-device-ovs-port.c -index 8406c3648cef..116f58c43ace 100644 ---- a/src/core/devices/ovs/nm-device-ovs-port.c -+++ b/src/core/devices/ovs/nm-device-ovs-port.c -@@ -188,8 +188,10 @@ del_iface_cb(GError *error, gpointer user_data) - static void - release_slave(NMDevice *device, NMDevice *slave, gboolean configure) - { -- NMDeviceOvsPort *self = NM_DEVICE_OVS_PORT(device); -- bool slave_removed = nm_device_sys_iface_state_get(slave) == NM_DEVICE_SYS_IFACE_STATE_REMOVED; -+ NMDeviceOvsPort *self = NM_DEVICE_OVS_PORT(device); -+ bool slave_not_managed = !NM_IN_SET(nm_device_sys_iface_state_get(slave), -+ NM_DEVICE_SYS_IFACE_STATE_MANAGED, -+ NM_DEVICE_SYS_IFACE_STATE_ASSUME); - - _LOGI(LOGD_DEVICE, "releasing ovs interface %s", nm_device_get_ip_iface(slave)); - -@@ -197,7 +199,7 @@ release_slave(NMDevice *device, NMDevice *slave, gboolean configure) - * removed and thus we're called with configure=FALSE), we still need - * to make sure its OVSDB entry is gone. - */ -- if (configure || slave_removed) { -+ if (configure || slave_not_managed) { - nm_ovsdb_del_interface(nm_ovsdb_get(), - nm_device_get_iface(slave), - del_iface_cb, --- -2.35.1 - diff --git a/SOURCES/readme-ifcfg-rh.txt b/SOURCES/readme-ifcfg-rh.txt new file mode 100644 index 0000000..b69a681 --- /dev/null +++ b/SOURCES/readme-ifcfg-rh.txt @@ -0,0 +1,31 @@ +NetworkManager stores new network profiles in keyfile format in the +/etc/NetworkManager/system-connections/ directory. + +Previously, NetworkManager stored network profiles in ifcfg format +in this directory (/etc/sysconfig/network-scripts/). However, the ifcfg +format is deprecated. By default, NetworkManager no longer creates +new profiles in this format. + +Connection profiles in keyfile format have many benefits. For example, +this format is INI file-based and can easily be parsed and generated. + +Each section in NetworkManager keyfiles corresponds to a NetworkManager +setting name as described in the nm-settings(5) and nm-settings-keyfile(5) +man pages. Each key-value-pair in a section is one of the properties +listed in the settings specification of the man page. + +If you still use network profiles in ifcfg format, consider migrating +them to keyfile format. To migrate all profiles at once, enter: + +# nmcli connection migrate + +This command migrates all profiles from ifcfg format to keyfile +format and stores them in /etc/NetworkManager/system-connections/. + +Alternatively, to migrate only a specific profile, enter: + +# nmcli connection migrate + +For further details, see: +* nm-settings-keyfile(5) +* nmcli(1) diff --git a/SPECS/NetworkManager.spec b/SPECS/NetworkManager.spec index 597c0a3..3402d01 100644 --- a/SPECS/NetworkManager.spec +++ b/SPECS/NetworkManager.spec @@ -1,22 +1,22 @@ - %global wpa_supplicant_version 1:1.1 %global ppp_version %(sed -n 's/^#define\\s*VERSION\\s*"\\([^\\s]*\\)"$/\\1/p' %{_includedir}/pppd/patchlevel.h 2>/dev/null | grep . || echo bad) %global glib2_version %(pkg-config --modversion glib-2.0 2>/dev/null || echo bad) %global epoch_version 1 -%global rpm_version 1.36.0 -%global real_version 1.36.0 -%global release_version 3 +%global real_version 1.39.90 +%global rpm_version %{real_version} +%global release_version 1 %global snapshot %{nil} %global git_sha %{nil} +%global bcond_default_debug 0 +%global bcond_default_test 1 %global obsoletes_device_plugins 1:0.9.9.95-1 %global obsoletes_ppp_plugin 1:1.5.3 %global obsoletes_initscripts_updown 1:1.36.0-0.6 +%global obsoletes_ifcfg_rh 1:1.36.2 -%global systemd_dir %{_prefix}/lib/systemd/system -%global sysctl_dir %{_prefix}/lib/sysctl.d %global nmlibdir %{_prefix}/lib/%{name} %global nmplugindir %{_libdir}/%{name}/%{version}-%{release} @@ -39,18 +39,6 @@ ############################################################################### -%if "x__BCOND_DEFAULT_DEBUG__" == "x1" || "x__BCOND_DEFAULT_DEBUG__" == "x0" -%global bcond_default_debug __BCOND_DEFAULT_DEBUG__ -%else -%global bcond_default_debug 0 -%endif - -%if "x__BCOND_DEFAULT_TEST__" == "x1" || "x__BCOND_DEFAULT_TEST__" == "x0" -%global bcond_default_test __BCOND_DEFAULT_TEST__ -%else -%global bcond_default_test 0 -%endif - %bcond_with meson %bcond_without adsl %bcond_without bluetooth @@ -147,9 +135,21 @@ %endif %if 0%{?rhel} > 8 || 0%{?fedora} > 32 -%global config_plugins_default keyfile,ifcfg-rh +%global config_plugins_default_ifcfg_rh 0 %else -%global config_plugins_default ifcfg-rh +%global config_plugins_default_ifcfg_rh 1 +%endif + +%if 0%{?rhel} > 9 || 0%{?fedora} > 35 +%global split_ifcfg_rh 1 +%else +%global split_ifcfg_rh 0 +%endif + +%if 0%{?rhel} > 8 || 0%{?fedora} > 35 +%global ifcfg_warning 1 +%else +%global ifcfg_warning 0 %endif %if 0%{?fedora} @@ -185,6 +185,7 @@ Source2: 00-server.conf Source4: 20-connectivity-fedora.conf Source5: 20-connectivity-redhat.conf Source6: 70-nm-connectivity.conf +Source7: readme-ifcfg-rh.txt # RHEL downstream patches that change behavior from upstream. # These are not bugfixes, hence they are also relevant after @@ -192,9 +193,7 @@ Source6: 70-nm-connectivity.conf # Patch0001: 0001-some.patch # Bugfixes that are only relevant until next rebase of the package. -Patch1001: 1001-wwan-dns-fix-rh2059138.patch -Patch1002: 1002-checkpoint-preserve-external-bridge-ports-rh2035519.patch -Patch1003: 1003-fix-ovsdb-removal-ports-rhbz1935026.patch +# Patch1001: 1001-some.patch Requires(post): systemd %if 0%{?fedora} || 0%{?rhel} > 7 @@ -218,6 +217,9 @@ Obsoletes: NetworkManager-wimax < 1.2 Suggests: NetworkManager-initscripts-updown %endif Obsoletes: NetworkManager < %{obsoletes_initscripts_updown} +%if 0%{?split_ifcfg_rh} +Obsoletes: NetworkManager < %{obsoletes_ifcfg_rh} +%endif %if 0%{?rhel} && 0%{?rhel} <= 7 # Kept for RHEL to ensure that wired 802.1x works out of the box @@ -240,8 +242,7 @@ BuildRequires: meson BuildRequires: automake BuildRequires: autoconf %endif -BuildRequires: intltool -BuildRequires: gettext-devel +BuildRequires: gettext-devel >= 0.19.8 BuildRequires: dbus-devel >= %{dbus_version} BuildRequires: glib2-devel >= 2.40.0 @@ -287,10 +288,12 @@ BuildRequires: /usr/bin/dbus-launch BuildRequires: python3 BuildRequires: python3-gobject-base BuildRequires: python3-dbus +BuildRequires: python3-pexpect %else BuildRequires: python2 BuildRequires: pygobject3-base BuildRequires: dbus-python +BuildRequires: pexpect %endif BuildRequires: libselinux-devel BuildRequires: polkit-devel @@ -527,6 +530,9 @@ deployments. %package dispatcher-routing-rules Summary: NetworkManager dispatcher file for advanced routing rules Group: System Environment/Base +%if 0%{?split_ifcfg_rh} +Requires: %{name}-initscripts-ifcfg-rh +%endif BuildArch: noarch Provides: %{name}-config-routing-rules = %{epoch}:%{version}-%{release} Obsoletes: %{name}-config-routing-rules < 1:1.31.0 @@ -551,6 +557,19 @@ by nm-connection-editor and nm-applet in a non-graphical environment. %endif +%if 0%{?split_ifcfg_rh} +%package initscripts-ifcfg-rh +Summary: NetworkManager plugin for reading and writing connections in ifcfg-rh format +Group: System Environment/Base +Requires: %{name} = %{epoch}:%{version}-%{release} +Obsoletes: NetworkManager < %{obsoletes_ifcfg_rh} + +%description initscripts-ifcfg-rh +Installs a plugin for reading and writing connection profiles using +the Red Hat ifcfg format in /etc/sysconfig/network-scripts/. +%endif + + %if %{with nm_cloud_setup} %package cloud-setup Summary: Automatically configure NetworkManager in cloud @@ -684,7 +703,6 @@ Preferably use nmcli instead. %endif -Dsession_tracking=systemd \ -Dsuspend_resume=systemd \ - -Dsystemdsystemunitdir=%{systemd_dir} \ -Dsystem_ca_path=/etc/pki/tls/cert.pem \ -Ddbus_conf_dir=%{dbus_sys_dir} \ -Dtests=yes \ @@ -701,7 +719,9 @@ Preferably use nmcli instead. -Dfirewalld_zone=false \ %endif -Ddist_version=%{version}-%{release} \ - -Dconfig_plugins_default=%{config_plugins_default} \ +%if %{?config_plugins_default_ifcfg_rh} + -Dconfig_plugins_default=ifcfg-rh \ +%endif -Dresolvconf=no \ -Dnetconfig=no \ -Dconfig_dns_rc_manager_default=%{dns_rc_manager_default} \ @@ -715,7 +735,6 @@ Preferably use nmcli instead. gtkdocize %endif autoreconf --install --force -intltoolize --automake --copy --force %configure \ --with-runstatedir=%{_rundir} \ --disable-silent-rules \ @@ -820,7 +839,6 @@ intltoolize --automake --copy --force --with-ebpf=%{ebpf_enabled} \ --with-session-tracking=systemd \ --with-suspend-resume=systemd \ - --with-systemdsystemunitdir=%{systemd_dir} \ --with-system-ca-path=/etc/pki/tls/cert.pem \ --with-dbus-sys-dir=%{dbus_sys_dir} \ --with-tests=yes \ @@ -842,7 +860,9 @@ intltoolize --automake --copy --force --disable-firewalld-zone \ %endif --with-dist-version=%{version}-%{release} \ - --with-config-plugins-default=%{config_plugins_default} \ +%if %{?config_plugins_default_ifcfg_rh} + --with-config-plugins-default=ifcfg-rh \ +%endif --with-resolvconf=no \ --with-netconfig=no \ --with-config-dns-rc-manager-default=%{dns_rc_manager_default} \ @@ -873,6 +893,10 @@ mkdir -p %{buildroot}%{_sysctldir} cp %{SOURCE6} %{buildroot}%{_sysctldir} %endif +%if 0%{?ifcfg_warning} +cp %{SOURCE7} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts +%endif + cp examples/dispatcher/10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/ ln -s ../no-wait.d/10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/pre-up.d/ ln -s ../10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/no-wait.d/ @@ -913,7 +937,7 @@ make -k %{?_smp_mflags} check || : %pre -if [ -f "%{systemd_dir}/network-online.target.wants/NetworkManager-wait-online.service" ] ; then +if [ -f "%{_unitdir}/network-online.target.wants/NetworkManager-wait-online.service" ] ; then # older versions used to install this file, effectively always enabling # NetworkManager-wait-online.service. We no longer do that and rely on # preset. @@ -1001,7 +1025,9 @@ fi %{dbus_sys_dir}/org.freedesktop.NetworkManager.conf %{dbus_sys_dir}/nm-dispatcher.conf %{dbus_sys_dir}/nm-priv-helper.conf +%if 0%{?split_ifcfg_rh} == 0 %{dbus_sys_dir}/nm-ifcfg-rh.conf +%endif %{_sbindir}/%{name} %{_bindir}/nmcli %{_datadir}/bash-completion/completions/nmcli @@ -1024,7 +1050,9 @@ fi %{_libexecdir}/nm-priv-helper %dir %{_libdir}/%{name} %dir %{nmplugindir} -%{nmplugindir}/libnm-settings-plugin*.so +%if 0%{?split_ifcfg_rh} == 0 +%{nmplugindir}/libnm-settings-plugin-ifcfg-rh.so +%endif %if %{with nmtui} %exclude %{_mandir}/man1/nmtui* %endif @@ -1042,6 +1070,7 @@ fi %{_mandir}/man8/nm-initrd-generator.8.gz %{_mandir}/man8/NetworkManager.8.gz %{_mandir}/man8/NetworkManager-dispatcher.8.gz +%{_mandir}/man8/NetworkManager-wait-online.service.8.gz %dir %{_localstatedir}/lib/NetworkManager %dir %{_sysconfdir}/sysconfig/network-scripts %{_datadir}/dbus-1/system-services/org.freedesktop.nm_dispatcher.service @@ -1052,13 +1081,16 @@ fi %{_prefix}/lib/firewalld/zones/nm-shared.xml %endif # systemd stuff -%{systemd_dir}/NetworkManager.service -%{systemd_dir}/NetworkManager-wait-online.service -%{systemd_dir}/NetworkManager-dispatcher.service -%{systemd_dir}/nm-priv-helper.service +%{_unitdir}/NetworkManager.service +%{_unitdir}/NetworkManager-wait-online.service +%{_unitdir}/NetworkManager-dispatcher.service +%{_unitdir}/nm-priv-helper.service %dir %{_datadir}/doc/NetworkManager/examples %{_datadir}/doc/NetworkManager/examples/server.conf -%doc NEWS AUTHORS README CONTRIBUTING.md TODO +%if 0%{?ifcfg_warning} +%{_sysconfdir}/sysconfig/network-scripts/readme-ifcfg-rh.txt +%endif +%doc NEWS AUTHORS README.md CONTRIBUTING.md %license COPYING %license COPYING.LGPL %license COPYING.GFDL @@ -1100,7 +1132,7 @@ fi %if %{with ovs} %files ovs %{nmplugindir}/libnm-device-plugin-ovs.so -%{systemd_dir}/NetworkManager.service.d/NetworkManager-ovs.conf +%{_unitdir}/NetworkManager.service.d/NetworkManager-ovs.conf %{_mandir}/man7/nm-openvswitch.7* %endif @@ -1171,11 +1203,18 @@ fi %endif +%if 0%{?split_ifcfg_rh} +%files initscripts-ifcfg-rh +%{nmplugindir}/libnm-settings-plugin-ifcfg-rh.so +%{dbus_sys_dir}/nm-ifcfg-rh.conf +%endif + + %if %{with nm_cloud_setup} %files cloud-setup %{_libexecdir}/nm-cloud-setup -%{systemd_dir}/nm-cloud-setup.service -%{systemd_dir}/nm-cloud-setup.timer +%{_unitdir}/nm-cloud-setup.service +%{_unitdir}/nm-cloud-setup.timer %{nmlibdir}/dispatcher.d/90-nm-cloud-setup.sh %{nmlibdir}/dispatcher.d/no-wait.d/90-nm-cloud-setup.sh %{_mandir}/man8/nm-cloud-setup.8* @@ -1190,9 +1229,88 @@ fi %changelog -* Fri Mar 11 2022 Thomas Haller - 1:1.36.0-3 -- core: preserve external bridge ports during checkpoint rollback (rh #2061711) -- ovs-port: fix removal of ovsdb entry if the interface goes away (rh #2061709) +* Tue Aug 16 2022 Ana Cabral - 1:1.39.90-1 +- Update to 1.39.90 release (release candidate) +- Add support for MPTCP (rh #2029636) +- nmcli: fix assertion failure (rh #2092323) +- bond: fix arp_ip_target option (rh #2117202) +- nmci: fix test restart_L2_only_lacp (rh #2092361) + +* Fri Jul 29 2022 Lubomir Rintel - 1:1.39.12-1 +- Update to 1.39.12 release (development) +- bridge: fix reapply support (rh #2092762) + +* Thu Jul 28 2022 Beniamino Galvani - 1:1.39.11-1 +- Update to 1.39.11 release (development) +- core: support nm.debug kernel command line option (rh #2102313) +- ovs: don't ever move unactivated devices to failed state (rh #2077950) +- dhclient: fix EXTENDED DHCP event handling (rh #2109285) +- core: make "nmcli net off/on" more robust (rh #2093175) +- bridge: add reapply support (rh #2092762) +- bridge: don't reset vlan filtering on external connections (rh #2107647) + +* Thu Jul 14 2022 Vojtech Bubela - 1:1.39.10-1 +- Update to 1.39.10 release (development) +- add support for {rto_min,quickack,advmss} route attributes (rh #2068525) +- fix empty hostname for "SaveHostname" and make setting hostname async (rh #2090946) + +* Thu Jun 30 2022 Lubomir Rintel - 1:1.39.8-1 +- Update to 1.39.8 release (development) +- core: make ipv6.addr-gen-mode default configurable (rh #1743161) (rh #2082682) +- dhcpv6: finish DAD before considering a lease to be good (rh #2096386) +- core: add connection.wait-activation-delay property (rh #2008337) + +* Thu Jun 16 2022 Thomas Haller - 1:1.39.7-2 +- fix priority of IPv6 addresses to prefer manual over DHCPv6 over SLAAC (rh #2097293) +- reverse order of priority for static IPv6 addresses in "ipv6.addresses" (rh #2097293) + +* Wed Jun 15 2022 Lubomir Rintel - 1:1.39.7-1 +- Update to 1.39.7 release (development) +- core: cancel the IP check on deactivation (rh #2080928) +- core: ensure DHCP is restarted every time the link goes up (rh #2079406) +- core: fix a leak of L3 configuration memory (rh #2083453) +- ppp: fix a race with pppd when removing addresses (rh #2085382) +- wifi: fix a crash when checking WEP supplicant capability (rh #2092782) + +* Wed Jun 1 2022 Beniamino Galvani - 1:1.39.6-1 +- Update to 1.39.6 release (development) +- Implement ACD (address conflict detection) for DHCPv4 (rh #1713380) + +* Thu May 19 2022 Ana Cabral - 1:1.39.5-1 +- Update to 1.39.5 release (development) +- dhcp: fix ignoring addresses with DHCPv6 otherconf (O flag) (rh #2083968) +- cloud-setup: reorder addresses to honor "primary_ip_address" (rh #2079849) + +* Wed May 4 2022 Wen Liang - 1:1.39.3-1 +- Update to 1.39.3 release (development) +- l3cfg: drop NM_L3_CFG_COMMIT_TYPE_ASSUME and assume_config_once (rh #2050216) + +* Thu Apr 21 2022 Thomas Haller - 1:1.39.2-1 +- Update to 1.39.2 release (development) +- dhcp: set "src" attribute for DHCP routes (rh #1995372) +- dhcp: drop internal DHCPv4 client based on systemd code (rh #2073067) +- core: delay startup complete for DNS update (rh #2049421) +- nmcli: support offline mode to create and edit keyfiles (rh #1361145) + +* Wed Apr 6 2022 Ana Cabral - 1:1.39.0-1 +- Upgrade to 1.39.0 release (development) +- Include a migration tool for ifcfg configuration to NM keyfiles + (rh #2059608) + +* Thu Mar 24 2022 Lubomir Rintel - 1:1.37.3-1 +- Upgrade to 1.37.3 release (development) +- core: allow reapply on autoconnect-slaves property change (rh #2065049) +- wifi: do not advertise channels outside regulatory domain (rh #2062785) +- wifi: warn about WEP being phased out (rh #2030997) +- bond: reject reapply when fail_over_mac was changed (rh #2003214) + +* Wed Mar 9 2022 Beniamino Galvani - 1:1.37.2-1 +- Upgrade to 1.37.2 release (development) +- core: preserve external ports during checkpoint rollback (rh #2061711) +- core: fix ovs bridge deletion (rh #2061709) +- core: shorten hostname when too long (rh #2033643) +- nm-online: bump the timeout upper limit to 2073600 seconds (rh #2025617) +- cloud-setup: fix crash when handling sigterm (rh #2027674) * Mon Feb 28 2022 Beniamino Galvani - 1:1.36.0-2 - core: fix setting DNS from WWAN and PPP (rh #2059138)