diff --git a/.NetworkManager.metadata b/.NetworkManager.metadata
index 95d4404..30eaae1 100644
--- a/.NetworkManager.metadata
+++ b/.NetworkManager.metadata
@@ -1 +1 @@
-adbe8e9eef649ac73c4fbaefd71a1335d4d016cd SOURCES/NetworkManager-1.36.0.tar.xz
+eba3800b6308c38916f22e8515fb415730a4e89a SOURCES/NetworkManager-1.40.0.tar.xz
diff --git a/.gitignore b/.gitignore
index db48e32..2ac6a43 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-SOURCES/NetworkManager-1.36.0.tar.xz
+SOURCES/NetworkManager-1.40.0.tar.xz
diff --git a/SOURCES/0002-firewall-Default-to-iptables-backend-to-preserve-behavior.patch b/SOURCES/0002-firewall-Default-to-iptables-backend-to-preserve-behavior.patch
index 8d4e50b..40aea35 100644
--- a/SOURCES/0002-firewall-Default-to-iptables-backend-to-preserve-behavior.patch
+++ b/SOURCES/0002-firewall-Default-to-iptables-backend-to-preserve-behavior.patch
@@ -10,10 +10,10 @@ always default to "iptables" to preserve behavior.
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/core/nm-firewall-utils.c b/src/core/nm-firewall-utils.c
-index a2446553b76f..5525a677cb1d 100644
+index 1311f5039910..3284b5ebaa4b 100644
--- a/src/core/nm-firewall-utils.c
+++ b/src/core/nm-firewall-utils.c
-@@ -744,12 +744,9 @@ nm_firewall_config_apply(NMFirewallConfig *self, gboolean shared)
+@@ -743,12 +743,9 @@ nm_firewall_config_apply(NMFirewallConfig *self, gboolean shared)
static NMFirewallBackend
_firewall_backend_detect(void)
{
diff --git a/SOURCES/0003-order-ipv6-addresses.patch b/SOURCES/0003-order-ipv6-addresses.patch
new file mode 100644
index 0000000..73c44b1
--- /dev/null
+++ b/SOURCES/0003-order-ipv6-addresses.patch
@@ -0,0 +1,75 @@
+From 94933a67129ea9d38010b58e4928ff41aa204692 Mon Sep 17 00:00:00 2001
+From: Thomas Haller
+Date: Wed, 4 May 2022 15:22:33 +0200
+Subject: [PATCH 1/1] Revert changes to order of static IPv6 addresses
+
+Upstream 1.38.0 and newer changed behavior so that static addresses in
+"ipv6.addresses" are sorted with most important first. That is then
+consistent with "ipv4.addresses".
+
+Revert this change for downstream RHEL.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=2097270
+---
+ src/core/nm-l3-config-data.c | 3 ++-
+ src/libnm-core-impl/nm-setting-ip6-config.c | 2 +-
+ src/libnmc-setting/settings-docs.h.in | 2 +-
+ src/nmcli/generate-docs-nm-settings-nmcli.xml.in | 2 +-
+ 4 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/src/core/nm-l3-config-data.c b/src/core/nm-l3-config-data.c
+index bcd0b62a8488..4640acad3796 100644
+--- a/src/core/nm-l3-config-data.c
++++ b/src/core/nm-l3-config-data.c
+@@ -2753,7 +2753,8 @@ _init_from_connection_ip(NML3ConfigData *self, int addr_family, NMConnection *co
+
+ naddresses = nm_setting_ip_config_get_num_addresses(s_ip);
+ for (i = 0; i < naddresses; i++) {
+- NMIPAddress *s_addr = nm_setting_ip_config_get_address(s_ip, i);
++ const guint addr_idx = IS_IPv4 ? i : (naddresses - i - 1);
++ NMIPAddress *s_addr = nm_setting_ip_config_get_address(s_ip, addr_idx);
+ NMPlatformIPXAddress a;
+ NMIPAddr addr_bin;
+ GVariant *label;
+diff --git a/src/libnm-core-impl/nm-setting-ip6-config.c b/src/libnm-core-impl/nm-setting-ip6-config.c
+index 8b593b97336a..0356888da324 100644
+--- a/src/libnm-core-impl/nm-setting-ip6-config.c
++++ b/src/libnm-core-impl/nm-setting-ip6-config.c
+@@ -998,7 +998,7 @@ nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
+ * format: a comma separated list of addresses
+ * description: A list of IPv6 addresses and their prefix length. Multiple addresses
+ * can be separated by comma. For example "2001:db8:85a3::8a2e:370:7334/64, 2001:db8:85a3::5/64".
+- * The addresses are listed in decreasing priority, meaning the first address will
++ * The addresses are listed in increasing priority, meaning the last address will
+ * be the primary address. This can make a difference with IPv6 source address selection
+ * (RFC 6724, section 5).
+ * ---end---
+diff --git a/src/libnmc-setting/settings-docs.h.in b/src/libnmc-setting/settings-docs.h.in
+index 1ed2f134196b..18e1ed28fc39 100644
+--- a/src/libnmc-setting/settings-docs.h.in
++++ b/src/libnmc-setting/settings-docs.h.in
+@@ -184,7 +184,7 @@
+ #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTES N_("A list of IPv4 destination addresses, prefix length, optional IPv4 next hop addresses, optional route metric, optional attribute. The valid syntax is: \"ip[/prefix] [next-hop] [metric] [attribute=val]...[,ip[/prefix]...]\". For example \"192.0.2.0/24 10.1.1.1 77, 198.51.100.0/24\".")
+ #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTING_RULES N_("A comma separated list of routing rules for policy routing.")
+ #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE N_("Configure method for creating the address for use with RFC4862 IPv6 Stateless Address Autoconfiguration. The permitted values are: NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64 (0), NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY (1). NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_DEFAULT_OR_EUI64 (2) or NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_DEFAULT (3). If the property is set to EUI64, the addresses will be generated using the interface tokens derived from hardware address. This makes the host part of the address to stay constant, making it possible to track host's presence when it changes networks. The address changes when the interface hardware is replaced. The value of stable-privacy enables use of cryptographically secure hash of a secret host-specific key along with the connection's stable-id and the network address as specified by RFC7217. This makes it impossible to use the address track host's presence, and makes the address stable when the network interface hardware is replaced. The special values \"default\" and \"default-or-eui64\" will fallback to the global connection default in as documented in NetworkManager.conf(5) manual. If the global default is not specified, the fallback value is \"stable-privacy\" or \"eui64\", respectively. For libnm, the property defaults to \"default\" since 1.40. Previously it defaulted to \"stable-privacy\". On D-Bus, the absence of an addr-gen-mode setting equals \"default\". For keyfile plugin, the absence of the setting on disk means \"default-or-eui64\" so that the property doesn't change on upgrade from older versions. Note that this setting is distinct from the Privacy Extensions as configured by \"ip6-privacy\" property and it does not affect the temporary addresses configured with this option.")
+-#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ADDRESSES N_("A list of IPv6 addresses and their prefix length. Multiple addresses can be separated by comma. For example \"2001:db8:85a3::8a2e:370:7334/64, 2001:db8:85a3::5/64\". The addresses are listed in decreasing priority, meaning the first address will be the primary address. This can make a difference with IPv6 source address selection (RFC 6724, section 5).")
++#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ADDRESSES N_("A list of IPv6 addresses and their prefix length. Multiple addresses can be separated by comma. For example \"2001:db8:85a3::8a2e:370:7334/64, 2001:db8:85a3::5/64\". The addresses are listed in increasing priority, meaning the last address will be the primary address. This can make a difference with IPv6 source address selection (RFC 6724, section 5).")
+ #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DAD_TIMEOUT N_("Timeout in milliseconds used to check for the presence of duplicate IP addresses on the network. If an address conflict is detected, the activation will fail. A zero value means that no duplicate address detection is performed, -1 means the default value (either configuration ipvx.dad-timeout override or zero). A value greater than zero is a timeout in milliseconds. The property is currently implemented only for IPv4.")
+ #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_DUID N_("A string containing the DHCPv6 Unique Identifier (DUID) used by the dhcp client to identify itself to DHCPv6 servers (RFC 3315). The DUID is carried in the Client Identifier option. If the property is a hex string ('aa:bb:cc') it is interpreted as a binary DUID and filled as an opaque value in the Client Identifier option. The special value \"lease\" will retrieve the DUID previously used from the lease file belonging to the connection. If no DUID is found and \"dhclient\" is the configured dhcp client, the DUID is searched in the system-wide dhclient lease file. If still no DUID is found, or another dhcp client is used, a global and permanent DUID-UUID (RFC 6355) will be generated based on the machine-id. The special values \"llt\" and \"ll\" will generate a DUID of type LLT or LL (see RFC 3315) based on the current MAC address of the device. In order to try providing a stable DUID-LLT, the time field will contain a constant timestamp that is used globally (for all profiles) and persisted to disk. The special values \"stable-llt\", \"stable-ll\" and \"stable-uuid\" will generate a DUID of the corresponding type, derived from the connection's stable-id and a per-host unique key. You may want to include the \"${DEVICE}\" or \"${MAC}\" specifier in the stable-id, in case this profile gets activated on multiple devices. So, the link-layer address of \"stable-ll\" and \"stable-llt\" will be a generated address derived from the stable id. The DUID-LLT time value in the \"stable-llt\" option will be picked among a static timespan of three years (the upper bound of the interval is the same constant timestamp used in \"llt\"). When the property is unset, the global value provided for \"ipv6.dhcp-duid\" is used. If no global value is provided, the default \"lease\" value is assumed.")
+ #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_HOSTNAME N_("If the \"dhcp-send-hostname\" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. This property and \"dhcp-fqdn\" are mutually exclusive and cannot be set at the same time.")
+diff --git a/src/nmcli/generate-docs-nm-settings-nmcli.xml.in b/src/nmcli/generate-docs-nm-settings-nmcli.xml.in
+index 371081b0e0da..5c036ab60149 100644
+--- a/src/nmcli/generate-docs-nm-settings-nmcli.xml.in
++++ b/src/nmcli/generate-docs-nm-settings-nmcli.xml.in
+@@ -718,7 +718,7 @@
+ description="DNS servers priority. The relative priority for DNS servers specified by this setting. A lower numerical value is better (higher priority). Negative values have the special effect of excluding other configurations with a greater numerical priority value; so in presence of at least one negative priority, only DNS servers from connections with the lowest priority value will be used. To avoid all DNS leaks, set the priority of the profile that should be used to the most negative value of all active connections profiles. Zero selects a globally configured default value. If the latter is missing or zero too, it defaults to 50 for VPNs (including WireGuard) and 100 for other connections. Note that the priority is to order DNS settings for multiple active connections. It does not disambiguate multiple DNS servers within the same connection profile. When multiple devices have configurations with the same priority, VPNs will be considered first, then devices with the best (lowest metric) default route and then all other devices. When using dns=default, servers with higher priority will be on top of resolv.conf. To prioritize a given server over another one within the same connection, just specify them in the desired order. Note that commonly the resolver tries name servers in /etc/resolv.conf in the order listed, proceeding with the next server in the list on failure. See for example the "rotate" option of the dns-options setting. If there are any negative DNS priorities, then only name servers from the devices with that lowest priority will be considered. When using a DNS resolver that supports Conditional Forwarding or Split DNS (with dns=dnsmasq or dns=systemd-resolved settings), each connection is used to query domains in its search list. The search domains determine which name servers to ask, and the DNS priority is used to prioritize name servers based on the domain. Queries for domains not present in any search list are routed through connections having the '~.' special wildcard domain, which is added automatically to connections with the default route (or can be added manually). When multiple connections specify the same domain, the one with the best priority (lowest numerical value) wins. If a sub domain is configured on another interface it will be accepted regardless the priority, unless parent domain on the other interface has a negative priority, which causes the sub domain to be shadowed. With Split DNS one can avoid undesired DNS leaks by properly configuring DNS priorities and the search domains, so that only name servers of the desired interface are configured." />
+
++ description="A list of IPv6 addresses and their prefix length. Multiple addresses can be separated by comma. For example "2001:db8:85a3::8a2e:370:7334/64, 2001:db8:85a3::5/64". The addresses are listed in increasing priority, meaning the last address will be the primary address. This can make a difference with IPv6 source address selection (RFC 6724, section 5)." />
+
+--
+2.36.1
+
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/9999-fix-pregen-doc.patch b/SOURCES/9999-fix-pregen-doc.patch
deleted file mode 100644
index c759e3f..0000000
--- a/SOURCES/9999-fix-pregen-doc.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 9603d930557bcd8268c3e36897db9941ea3af0b7 Mon Sep 17 00:00:00 2001
-From: Thomas Haller
-Date: Tue, 27 Aug 2019 15:47:32 +0200
-Subject: [PATCH] patch documentation with the proper default values
-
-We don't regenerate the documentation for RHEL builds, but
-the docs from the tarball are generated with a certain set
-of defaults.
-
-Patch the man pages with the proper values.
----
- docs/api/html/NetworkManager.conf.html | 2 +-
- man/NetworkManager.conf.5 | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/docs/api/html/NetworkManager.conf.html b/docs/api/html/NetworkManager.conf.html
-index 02029c2e336a..cf9269c7bef4 100644
---- a/docs/api/html/NetworkManager.conf.html
-+++ b/docs/api/html/NetworkManager.conf.html
-@@ -663,7 +663,7 @@ unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth
- are "syslog
" and "journal
".
- When NetworkManager is started with "--debug
"
- in addition all messages will be printed to stderr.
-- If unspecified, the default is "syslog
".
-+ If unspecified, the default is "journal
".
-
-
-
-diff --git a/man/NetworkManager.conf.5 b/man/NetworkManager.conf.5
-index 4f62ed7c0cde..74daf4c8dc02 100644
---- a/man/NetworkManager.conf.5
-+++ b/man/NetworkManager.conf.5
-@@ -669,7 +669,7 @@ INFO\&.
- .PP
- \fIbackend\fR
- .RS 4
--The logging backend\&. Supported values are "syslog" and "journal"\&. When NetworkManager is started with "\-\-debug" in addition all messages will be printed to stderr\&. If unspecified, the default is "syslog"\&.
-+The logging backend\&. Supported values are "syslog" and "journal"\&. When NetworkManager is started with "\-\-debug" in addition all messages will be printed to stderr\&. If unspecified, the default is "journal"\&.
- .RE
- .PP
- \fIaudit\fR
---
-2.31.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 2fab53b..6b52376 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 2
+%global real_version 1.40.0
+%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 0
%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
@@ -61,8 +49,7 @@
%bcond_without ppp
%bcond_without nmtui
%bcond_without nm_cloud_setup
-# on RHEL we don't regenerate the documentation
-%bcond_with regen_docs
+%bcond_without regen_docs
%if %{bcond_default_debug}
%bcond_without debug
%else
@@ -84,12 +71,12 @@
%else
%bcond_with connectivity_fedora
%endif
-%if 0%{?rhel} && 0%{?rhel} > 7
+%if 0%{?rhel} && 0%{?rhel} >= 8
%bcond_without connectivity_redhat
%else
%bcond_with connectivity_redhat
%endif
-%if 0%{?fedora} > 28 || 0%{?rhel} > 7
+%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8
%bcond_without crypto_gnutls
%else
%bcond_with crypto_gnutls
@@ -99,7 +86,7 @@
%else
%bcond_without iwd
%endif
-%if 0%{?fedora} > 31 || 0%{?rhel} > 7
+%if 0%{?fedora} >= 32 || 0%{?rhel} >= 8
%bcond_without firewalld_zone
%else
%bcond_with firewalld_zone
@@ -107,7 +94,7 @@
###############################################################################
-%if 0%{?fedora} || 0%{?rhel} > 7
+%if 0%{?fedora} || 0%{?rhel} >= 8
%global dbus_version 1.9.18
%global dbus_sys_dir %{_datadir}/dbus-1/system.d
%else
@@ -129,15 +116,15 @@
%global with_modem_manager_1 0
%endif
-%if 0%{?fedora} >= 31 || 0%{?rhel} > 7
+%if 0%{?fedora} >= 31 || 0%{?rhel} >= 8
%global dhcp_default internal
%else
%global dhcp_default dhclient
%endif
-%if 0%{?fedora} || 0%{?rhel} > 7
+%if 0%{?fedora} || 0%{?rhel} >= 8
%global logging_backend_default journal
-%if 0%{?fedora} || 0%{?rhel} > 8
+%if 0%{?fedora} || 0%{?rhel} >= 9
%global dns_rc_manager_default auto
%else
%global dns_rc_manager_default symlink
@@ -147,10 +134,22 @@
%global dns_rc_manager_default file
%endif
-%if 0%{?rhel} > 8 || 0%{?fedora} > 32
-%global config_plugins_default keyfile,ifcfg-rh
+%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
+%global config_plugins_default_ifcfg_rh 0
+%else
+%global config_plugins_default_ifcfg_rh 1
+%endif
+
+%if 0%{?fedora} >= 36 || 0%{?rhel} >= 10
+%global split_ifcfg_rh 1
%else
-%global config_plugins_default ifcfg-rh
+%global split_ifcfg_rh 0
+%endif
+
+%if 0%{?fedora} >= 36 || 0%{?rhel} >= 9
+%global ifcfg_warning 1
+%else
+%global ifcfg_warning 0
%endif
%if 0%{?fedora}
@@ -186,24 +185,20 @@ 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
# the next rebase of the source tarball.
Patch1: 0001-cloud-setup-systemd-unit-rh1791758.patch
Patch2: 0002-firewall-Default-to-iptables-backend-to-preserve-behavior.patch
+Patch3: 0003-order-ipv6-addresses.patch
# Bugfixes that are only relevant until next rebase of the package.
-Patch1001: 1001-wwan-dns-fix-rh2059138.patch
-
-# The pregenerated docs contain default values and paths that depend
-# on the configure options when creating the source tarball.
-# As last step, patch the documentation with the proper defaults
-# for RHEL.
-Patch9999: 9999-fix-pregen-doc.patch
+# Patch1001: 1001-some.patch
Requires(post): systemd
-%if 0%{?fedora} || 0%{?rhel} > 7
+%if 0%{?fedora} || 0%{?rhel} >= 8
Requires(post): systemd-udev
%endif
Requires(post): /usr/sbin/update-alternatives
@@ -224,6 +219,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
@@ -246,8 +244,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
@@ -289,14 +286,16 @@ BuildRequires: mobile-broadband-provider-info-devel
BuildRequires: newt-devel
%endif
BuildRequires: /usr/bin/dbus-launch
-%if 0%{?fedora} > 27 || 0%{?rhel} > 7
+%if 0%{?fedora} >= 28 || 0%{?rhel} >= 8
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
@@ -311,7 +310,7 @@ BuildRequires: libubsan
BuildRequires: firewalld-filesystem
%endif
BuildRequires: iproute
-%if 0%{?fedora} || 0%{?rhel} > 7
+%if 0%{?fedora} || 0%{?rhel} >= 8
BuildRequires: iproute-tc
%endif
@@ -400,7 +399,7 @@ Requires: wireless-regdb
Requires: crda
%endif
-%if %{with iwd} && (0%{?fedora} > 24 || 0%{?rhel} > 7)
+%if %{with iwd} && (0%{?fedora} >= 25 || 0%{?rhel} >= 8)
Requires: (wpa_supplicant >= %{wpa_supplicant_version} or iwd)
Suggests: wpa_supplicant
%else
@@ -533,6 +532,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
@@ -557,6 +559,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
@@ -690,7 +705,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 \
@@ -707,7 +721,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} \
@@ -721,11 +737,10 @@ Preferably use nmcli instead.
gtkdocize
%endif
autoreconf --install --force
-intltoolize --automake --copy --force
%configure \
--with-runstatedir=%{_rundir} \
- --disable-silent-rules \
- --disable-static \
+ --enable-silent-rules=no \
+ --enable-static=no \
--with-nft=/usr/sbin/nft \
--with-iptables=/usr/sbin/iptables \
--with-dhclient=yes \
@@ -740,26 +755,26 @@ intltoolize --automake --copy --force
%if %{with sanitizer}
--with-address-sanitizer=exec \
%if 0%{?fedora} || 0%{?rhel} >= 8
- --enable-undefined-sanitizer \
+ --enable-undefined-sanitizer=yes \
%else
- --disable-undefined-sanitizer \
+ --enable-undefined-sanitizer=no \
%endif
%else
--with-address-sanitizer=no \
- --disable-undefined-sanitizer \
+ --enable-undefined-sanitizer=no \
%endif
%if %{with debug}
- --enable-more-logging \
+ --enable-more-logging=yes \
--with-more-asserts=10000 \
%else
- --disable-more-logging \
- --without-more-asserts \
+ --enable-more-logging=no \
+ --with-more-asserts=0 \
%endif
- --enable-ld-gc \
+ --enable-ld-gc=yes \
%if %{with lto}
- --enable-lto \
+ --enable-lto=yes \
%else
- --disable-lto \
+ --enable-lto=no \
%endif
--with-libaudit=yes-disabled-by-default \
%if 0%{?with_modem_manager_1}
@@ -798,11 +813,11 @@ intltoolize --automake --copy --force
--with-nm-cloud-setup=no \
%endif
--enable-vala=yes \
- --enable-introspection \
+ --enable-introspection=yes \
%if %{with regen_docs}
- --enable-gtk-doc \
+ --enable-gtk-doc=yes \
%else
- --disable-gtk-doc \
+ --enable-gtk-doc=no \
%endif
%if %{with team}
--enable-teamdctl=yes \
@@ -817,16 +832,15 @@ intltoolize --automake --copy --force
--with-selinux=yes \
--enable-polkit=yes \
--enable-modify-system=yes \
- --enable-concheck \
+ --enable-concheck=yes \
%if 0%{?fedora}
- --with-libpsl \
+ --with-libpsl=yes \
%else
- --without-libpsl \
+ --with-libpsl=no \
%endif
--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 \
@@ -843,12 +857,14 @@ intltoolize --automake --copy --force
--enable-ppp=yes \
%endif
%if %{with firewalld_zone}
- --enable-firewalld-zone \
+ --enable-firewalld-zone=yes \
%else
- --disable-firewalld-zone \
+ --enable-firewalld-zone=no \
%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} \
@@ -879,6 +895,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/
@@ -919,7 +939,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.
@@ -1007,7 +1027,9 @@ fi
%{dbus_sys_dir}/org.freedesktop.NetworkManager.conf
%{dbus_sys_dir}/nm-dispatcher.conf
%exclude %{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
@@ -1030,7 +1052,9 @@ fi
%exclude %{_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
@@ -1048,6 +1072,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
@@ -1058,13 +1083,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
-%exclude %{systemd_dir}/nm-priv-helper.service
+%{_unitdir}/NetworkManager.service
+%{_unitdir}/NetworkManager-wait-online.service
+%{_unitdir}/NetworkManager-dispatcher.service
+%exclude %{_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
@@ -1106,7 +1134,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
@@ -1177,11 +1205,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*
@@ -1196,6 +1231,96 @@ fi
%changelog
+* Fri Aug 26 2022 Ana Cabral - 1:1.40.0-1
+- Update to 1.40.0 release
+
+* Tue Aug 16 2022 Ana Cabral - 1:1.39.90-1
+- Update to 1.39.90 release (release candidate)
+- bridge: fix reapply of non-bridge properties (rh #2092762)
+- bridge: fix wired.mtu reapply (rh #2076131)
+
+* 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)
+- dhcp: fix EXTENDED DHCP event to accept lease for dhclient plugin (rh #2109285)
+- ovs: honor unmanaged setting also for interfaces that fail (rh #2077950)
+
+* Thu Jul 14 2022 Vojtech Bubela - 1:1.39.10-1
+- Update to 1.39.10 release (development)
+- initrd: set a default carrier timeout of 10 seconds in initrd (rh #2079277)
+- dhcp: wait DAD completion for DHCPv6 addresses (rh #2096386)
+- libnm: support wait-activation-delay property (rh #2008337)
+- veth: fix veth activation on booting (rh #2105956)
+- support a ipv6.addr-gen-mode knob in the global config (rh #208268)
+
+* 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 #2097270)
+
+* 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)
+- device: commit l3cfg on link change only when the device is activating (rh #2079054)
+- l3cfg: during reapply, also clear IPv6 temporary addresses (rh #2082230)
+- dhcp: support overlong DHCP host names (rh #2033643)
+- cloud-setup: reorder addresses to honor "primary_ip_address" (rh #2082000)
+
+* Wed May 4 2022 Thomas Haller - 1:1.39.3-1
+- Update to 1.39.3 release (development)
+- dhcp: save leases in /run (rh #1943153)
+- ovs: use asynchronous attach-port (rh #2052441)
+- device: set MTU after attaching bond port (rh #2071985)
+- l3cfg: drop NM_L3_CFG_COMMIT_TYPE_ASSUME and assume_config_once (rh #2077605)
+
+* Thu Apr 21 2022 Thomas Haller - 1:1.39.2-2
+- generate docs during build instead of using pre-generated (2) (rh #1995915)
+
+* 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
+- Update to 1.39.0 release (development)
+- ovs, dpdk: fix creating ovs-interface when the ovs-bridge is netdev
+ (rh #2001792)
+
+* 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 #2035519)
+- core: fix ovs bridge deletion (rh #1935026)
+- 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)