diff --git a/SOURCES/1001-core-increase-limit-of-open-file-descriptors-for-Net.patch b/SOURCES/1001-core-increase-limit-of-open-file-descriptors-for-Net.patch new file mode 100644 index 0000000..de68a7b --- /dev/null +++ b/SOURCES/1001-core-increase-limit-of-open-file-descriptors-for-Net.patch @@ -0,0 +1,41 @@ +From a5eb2f55d79b9023fbda6945da09f9bcecea8560 Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Sun, 28 Feb 2021 11:18:16 +0100 +Subject: [PATCH 1/1] core: increase limit of open file descriptors for + NetworkManager.service + +Note that POSIX select() can only handle up to 1024 descriptors. That +means, our code (and the libraries that we use) must not use select(). + +Note that libndp uses select(), which means NetworkManager will crash +when using file descriptors larger than 1023. On the other hand, +depriving NetworkManager of file descriptors will also crash it. +So libndp must be fixed ([1]). + +[1] https://listman.redhat.com/archives/libndp-list/2021-February/msg00000.html + +https://bugzilla.redhat.com/show_bug.cgi?id=1926599 +(cherry picked from commit a708a172a6a289d5399897e7da3a0e38721b1b7e) +(cherry picked from commit 2ca405fa9bd047593cd299691b74af7f44184c71) +--- + data/NetworkManager.service.in | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/data/NetworkManager.service.in b/data/NetworkManager.service.in +index 91ebd9a36e65..9cf1c3d28f47 100644 +--- a/data/NetworkManager.service.in ++++ b/data/NetworkManager.service.in +@@ -19,6 +19,10 @@ CapabilityBoundingSet=CAP_NET_ADMIN CAP_DAC_OVERRIDE CAP_NET_RAW CAP_NET_BIND_SE + ProtectSystem=true + ProtectHome=read-only + ++# We require file descriptors for DHCP etc. When activating many interfaces, ++# the default limit of 1024 is easily reached. ++LimitNOFILE=65536 ++ + [Install] + WantedBy=multi-user.target + Also=NetworkManager-dispatcher.service +-- +2.29.2 + diff --git a/SOURCES/1002-initrd-apply-mtu-to-bond-connection.patch b/SOURCES/1002-initrd-apply-mtu-to-bond-connection.patch new file mode 100644 index 0000000..22e20b1 --- /dev/null +++ b/SOURCES/1002-initrd-apply-mtu-to-bond-connection.patch @@ -0,0 +1,81 @@ +From 9ab6906ea1c2ddd23a3926b35ed75128dd302d13 Mon Sep 17 00:00:00 2001 +From: Beniamino Galvani +Date: Mon, 1 Mar 2021 21:16:08 +0100 +Subject: [PATCH] initrd: apply the MTU from bond= argument to the bond + connection + +Currently the MTU specified in: + + bond=[::[:[:]]] + +gets applied to the bond ports. Instead it should be applied to the +bond itself. + +Fixes: ecc074b2f8a6 ('initrd: add command line parser') + +https://bugzilla.redhat.com/show_bug.cgi?id=1932502 +https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/767 +(cherry picked from commit 8df3ef5063cf0f8ee904f8fd39e9e64cc60836eb) +(cherry picked from commit 43d16d2cd63a3443704ca7bb539ba5cb673ba183) +--- + src/core/initrd/nmi-cmdline-reader.c | 5 +++-- + src/core/initrd/tests/test-cmdline-reader.c | 7 ++++++- + 2 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/src/core/initrd/nmi-cmdline-reader.c b/src/core/initrd/nmi-cmdline-reader.c +index 508ef2b25c..5f40f63ef2 100644 +--- a/src/core/initrd/nmi-cmdline-reader.c ++++ b/src/core/initrd/nmi-cmdline-reader.c +@@ -764,6 +764,9 @@ reader_parse_master(Reader *reader, char *argument, const char *type_name, const + mtu = get_word(&argument, ':'); + } + ++ if (mtu) ++ connection_set(connection, NM_SETTING_WIRED_SETTING_NAME, NM_SETTING_WIRED_MTU, mtu); ++ + do { + slave = get_word(&slaves, ','); + if (slave == NULL) +@@ -777,8 +780,6 @@ reader_parse_master(Reader *reader, char *argument, const char *type_name, const + NM_SETTING_CONNECTION_MASTER, + master, + NULL); +- if (mtu) +- connection_set(connection, NM_SETTING_WIRED_SETTING_NAME, NM_SETTING_WIRED_MTU, mtu); + } while (slaves && *slaves != '\0'); + + if (argument && *argument) +diff --git a/src/core/initrd/tests/test-cmdline-reader.c b/src/core/initrd/tests/test-cmdline-reader.c +index 33fb22d364..4b450aae0f 100644 +--- a/src/core/initrd/tests/test-cmdline-reader.c ++++ b/src/core/initrd/tests/test-cmdline-reader.c +@@ -825,13 +825,14 @@ test_bond(void) + { + gs_unref_hashtable GHashTable *connections = NULL; + const char *const * ARGV = NM_MAKE_STRV("rd.route=192.0.2.53::bong0", +- "bond=bong0:eth0,eth1:mode=balance-rr", ++ "bond=bong0:eth0,eth1:mode=balance-rr:9000", + "nameserver=203.0.113.53"); + NMConnection * connection; + NMSettingConnection * s_con; + NMSettingIPConfig * s_ip4; + NMSettingIPConfig * s_ip6; + NMSettingBond * s_bond; ++ NMSettingWired * s_wired; + NMIPRoute * ip_route; + const char * master_uuid; + +@@ -847,6 +848,10 @@ test_bond(void) + master_uuid = nm_connection_get_uuid(connection); + g_assert(master_uuid); + ++ s_wired = nm_connection_get_setting_wired(connection); ++ g_assert(s_wired); ++ g_assert_cmpint(nm_setting_wired_get_mtu(s_wired), ==, 9000); ++ + s_ip4 = nm_connection_get_setting_ip4_config(connection); + g_assert(s_ip4); + g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_AUTO); +-- +2.29.2 + diff --git a/SPECS/NetworkManager.spec b/SPECS/NetworkManager.spec index 2892679..1e7725a 100644 --- a/SPECS/NetworkManager.spec +++ b/SPECS/NetworkManager.spec @@ -7,7 +7,7 @@ %global epoch_version 1 %global rpm_version 1.30.0 %global real_version 1.30.0 -%global release_version 2 +%global release_version 4 %global snapshot %{nil} %global git_sha %{nil} @@ -187,6 +187,8 @@ Patch1: 0001-cloud-setup-systemd-unit-rh1791758.patch # Bugfixes that are only relevant until next rebase of the package. Patch1000: 1000-bond-avoid-logging-warning-to-set-ad_actor_system-00.patch +Patch1001: 1001-core-increase-limit-of-open-file-descriptors-for-Net.patch +Patch1002: 1002-initrd-apply-mtu-to-bond-connection.patch # The pregenerated docs contain default values and paths that depend # on the configure options when creating the source tarball. @@ -203,6 +205,7 @@ Requires(postun): systemd Requires: dbus >= %{dbus_version} Requires: glib2 >= %{glib2_version} Requires: %{name}-libnm%{?_isa} = %{epoch}:%{version}-%{release} +Requires: libndp >= 1.7-4 Obsoletes: dhcdbd Obsoletes: NetworkManager < %{obsoletes_device_plugins} Obsoletes: NetworkManager < %{obsoletes_ppp_plugin} @@ -1150,6 +1153,13 @@ fi %changelog +* Fri Mar 12 2021 Beniamino Galvani - 1:1.30.0-4 +- initrd: apply the MTU from bond= argument to the bond connection (rh #1936610) + +* Fri Mar 12 2021 Thomas Haller - 1:1.30.0-3 +- Increase LimitNOFILE to allow more than 1024 file descriptors (rh #1926599). + This requires a suitable libndp version that can handle many file descriptors (rh #1933041). + * Tue Feb 23 2021 Thomas Haller - 1:1.30.0-2 - Avoid logging warning setting bond ad_actor_system (rh #1923999)