diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-01-29 18:03:51 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-01-29 18:03:51 +0000 |
commit | d7ed2b01311f15ba54fe8ea872aab7d59ab2b193 (patch) | |
tree | 1814dd2b5bbf2e7639fdafbeef48d228cfaf5e9b /net-misc/networkmanager | |
parent | abaa75b10f899ada8dd05b23cc03205064394bc6 (diff) |
gentoo resync : 29.01.2021
Diffstat (limited to 'net-misc/networkmanager')
-rw-r--r-- | net-misc/networkmanager/Manifest | 3 | ||||
-rw-r--r-- | net-misc/networkmanager/files/networkmanager-1.28.0-dhcpcd9.patch | 265 | ||||
-rw-r--r-- | net-misc/networkmanager/networkmanager-1.28.0-r1.ebuild (renamed from net-misc/networkmanager/networkmanager-1.28.0.ebuild) | 6 |
3 files changed, 272 insertions, 2 deletions
diff --git a/net-misc/networkmanager/Manifest b/net-misc/networkmanager/Manifest index b202a31d5ab4..03618080f14a 100644 --- a/net-misc/networkmanager/Manifest +++ b/net-misc/networkmanager/Manifest @@ -4,6 +4,7 @@ AUX conf.d.NetworkManager 230 BLAKE2B 987b6b39c6c8b14a788575241575f9a0761f320117 AUX init.d.NetworkManager-r2 1880 BLAKE2B d765a298955cdcf0c62518488fc9f02f97c31ee645c7b15ed73914397e02266e1b72a32af1d9f8007ae81119e9223b3e41184aa58b9fa328ed72e0ebec91acd8 SHA512 f06e7e6b6ebeb991471cf6e71c44687210a115fd008505ebe01de1b52a059952c2b191789d217412ae30daaaecf8bc028c89daf536af793eac23cfcd62ba9ad4 AUX networkmanager-1.20.6-dont_call_helpers_with_full_paths.patch 574 BLAKE2B 179dfdcdb97bfc66adbeb58ca0e0b8f95f6d1cc0687fef338bc25ac59b4dc83e20e547d419ef8cea482c6302a05bbce8279c868f00c0cb173f42ebdc6a4bdcae SHA512 ab3e96bbd88b4a5c0aac59dc8de437be78f2e77762d6bc9c99e3b1ff1d7db39a054c4fd9ba9e2f6f9907da1ef66c8af310562addaa79ecd9e9812564f609a273 AUX networkmanager-1.26.4-iwd-fixes-pr640.patch 5730 BLAKE2B e22539fef2e4582ab156decbe26667724de181eb2349f7dcb29c41eaf9f918addb4a6e25a43e8b743e118cab56e3f69cc83e0e8ee777560c227165fad67664b9 SHA512 690d128ac153b2147f13f8596858be6e6120c0a744da1cb5e2dad5ce6ae9518565ab15a9a00612771d153ed5e13d60a42f93fae6b7ba177513c9d1bf0a4d701a +AUX networkmanager-1.28.0-dhcpcd9.patch 10608 BLAKE2B fb5512d4b290ae668b41b2d1f387643e8d7c1c235ec255c292e419551c3a67a06463f43293ea75f8dd9700bde2d045e86eafe313384c22609cb8422117ac092f SHA512 7f9a2a3b7f861cc2c8e4b066449e6574ac74227b7a45ae8e9ca79c81a232d292a62216edff0620042f9556193e3841aa8cf5e8ecdbc2edfc9df0751e2d1f5303 DIST NetworkManager-1.22.10.tar.bz2 6292347 BLAKE2B b6cb06a0630685714cdd3c8b8e1d788a6e979c2d7f232259e682fdc9e1f5569259731fdbbea65b6e8321561ecb8354b6f7a0b10843eb17cbe6f5937af8d9d898 SHA512 61b6214188a3cd281d0d5a5b8bfc402f8a19d8beaa6a3a2bd85983991cc66d62b2c3785d7ca652373903d53331610cd63a45d94bdb355196d939c48f42be29c1 DIST NetworkManager-1.26.0.tar.xz 4956796 BLAKE2B 752b6b47387bac5787d06be7f31cc7387798d0c917977c8e72d6d21538a86c167003901d628e596109aec28816f56fd8cd6bf2b46a8d4918a7e6cf1946586550 SHA512 46035fda8f154497ba4a634e4bf7f0a11f579d0d3f4ffdcea7d47ea0bde6dd0183885491f5453255af7b163ae3db4f0c62c3161913a8c30c35b6475887235b6d DIST NetworkManager-1.26.2.tar.xz 4972240 BLAKE2B f9f0879ad01d7aee8edc28b33a08d903637b0a9c0738d64480394d0298a02e4fa4277f6a14a7fec62eeb7e1ca50646f47d08f735827b5dbe698070669fd558c4 SHA512 4029bf5224523d851a36766376813c7edc85c2fef3600ceaffc0c7e6faadcfebf843a406ee071bdc59c21bceb7bf3de8c87fca6bb2f2116d9eddbb70e11bf517 @@ -15,5 +16,5 @@ EBUILD networkmanager-1.26.0-r1.ebuild 11208 BLAKE2B f69905ebe2031f6e707c9c1907e EBUILD networkmanager-1.26.2-r1.ebuild 11214 BLAKE2B b9bf75442380146f2b7eb73f8022cbd30eaecb47e9f48ab96300e26471ecfa1949f076749b23604cc8c5b34264858788cf638c74221bbc5bef2d04e0f219e19d SHA512 eb92e2db85fb28e961494c6425eab2f3a03d61c4efa94d5cdbf1393b7f4d90e55b6cc958f2ec7c0079250f8a51827d42a477ec459bffaa508e6817f4ab8c0d12 EBUILD networkmanager-1.26.4.ebuild 11353 BLAKE2B a8940cf649a0da4ba84dbc5daeba55f87360efb744f722d743d4550df223c20ae7a4defb1e9b168005d2fdac0a139d290840c2713a42d9e666d901a8beb8a880 SHA512 5b36c4a6f28098480ac33b506cb01ffb89e7d8aff575b0019ecc67e0bd3f9df80c3be8c0d0b2f460cfb82f77c84ae41f1635901987a7d48062b741bbed66b1ba EBUILD networkmanager-1.26.6.ebuild 11359 BLAKE2B f129d1aa0f60a115786e6833fd6cfa43f7b28174fd83cf74c09db9fb69222235e2a424ea8a0993bf4ca14dd24f5e942961f2780a1fdb6806a0ead0f616a6fae7 SHA512 2568a02a564e5be9135880e6e80d587eae81fccbf1469c78830f3580da69ab02d6090a0371697919d39082da6ef50c6a35aeb1318fa7c25a1159c321767a677c -EBUILD networkmanager-1.28.0.ebuild 11194 BLAKE2B 8da159c9aab4f097f47e02ff3b5742afb9b3d667aa053d54fe9d342f8e6f8a7acceeaa26827bdb51991abc3c42b17f5fd6dbb2e3ee2098fcaa9939c8da0ddb6a SHA512 9448c3ee69ef0790733524e932d1f134f4dc11660cf5489442d45ed2e92cc45964dc52c94d9af47e696b08873547b376e511854d71d48cf9cb6a4755dd5ba2c7 +EBUILD networkmanager-1.28.0-r1.ebuild 11257 BLAKE2B 90019d8979bd30efc7f440bd58ed74c829384cd9e7813ad67a811eb14d8abb24443b0538a99fafa4e24fa1c7e8d1fa5849ad0edc5cf704c627d3b65e8dbdf97a SHA512 0c4563bdee518f149bb4592198ff9f6048273f1c4d9152799e4d1f9da20eccc02ee3bffc774e4f962c38796a94244ea0bf0388079adf0f35aa3a17071ee12564 MISC metadata.xml 2182 BLAKE2B 699e4c087f213e132e3787d7c2f913b23bf79f4fb78037bd92510de0655863eb7ad2148a615b68b84ad14309624c25802bcbf65ee3052a6b84d20d2b8657bae6 SHA512 f8fbb50dbe481b3530e8ac6446c43e385095f04ad36c33a3ac73964675468b0d4cf47eab8698bc338d5fabc1f9f9ad2ad99edffac69aace897c88fa88f1dcfe3 diff --git a/net-misc/networkmanager/files/networkmanager-1.28.0-dhcpcd9.patch b/net-misc/networkmanager/files/networkmanager-1.28.0-dhcpcd9.patch new file mode 100644 index 000000000000..cfa642dd29b0 --- /dev/null +++ b/net-misc/networkmanager/files/networkmanager-1.28.0-dhcpcd9.patch @@ -0,0 +1,265 @@ +From a58a89213bf4d0cefb155fef1ec9425f7a6ca5c8 Mon Sep 17 00:00:00 2001 +From: Roy Marples <roy@marples.name> +Date: Tue, 19 Jan 2021 05:04:31 +0000 +Subject: [PATCH] DHCP: Support dhcpcd-9.x + +This locks NM into dhcpcd-9.3.3 as that is the first version to support +the --noconfigure option. Older versions are no longer supported by NM +because they do modify the host which is undesirable. + +Due to the way dhcpcd-9 uses privilege separation and that it re-parents +itself to PID 1, the main process cannot be reaped or waited for. +So we rely on dhcpcd correctly cleaning up after itself. +A new function nm_dhcp_client_stop_watch_child() has been added +so that dhcpcd can perform similar cleanup to the equivalent stop call. + +As part of this change, the STOP and STOPPED reasons are mapped to +NM_DHCP_STATE_DONE and PREINIT is mapped to a new state NM_DHCP_STATE_NOOP +which means NM should just ignore this state. + +https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/668 +--- + NEWS | 3 ++ + src/dhcp/nm-dhcp-client.c | 20 +++++++++- + src/dhcp/nm-dhcp-client.h | 3 ++ + src/dhcp/nm-dhcp-dhcpcd.c | 82 ++++++++++++++++++++------------------- + 4 files changed, 67 insertions(+), 41 deletions(-) + +diff --git a/NEWS b/NEWS +index 8a48587e5..958bbe91c 100644 +--- a/NEWS ++++ b/NEWS +@@ -45,6 +45,9 @@ USE AT YOUR OWN RISK. NOT RECOMMENDED FOR PRODUCTION USE! + cmdline argument actually generates a connection which disables both + ipv4 and ipv6. Previously the generated connection would disable ipv4 + but ipv6 would be set to the 'auto' method. ++* The dhcpcd plugin now requires a minimum version of dhcpcd-9.3.3 with ++ the --noconfigure option. Using an older version will cause dhcpcd to ++ exit with a status code of 1. + + ============================================= + NetworkManager-1.26 +diff --git a/src/dhcp/nm-dhcp-client.c b/src/dhcp/nm-dhcp-client.c +index 46ab48959..56f599abf 100644 +--- a/src/dhcp/nm-dhcp-client.c ++++ b/src/dhcp/nm-dhcp-client.c +@@ -367,10 +367,13 @@ reason_to_state(NMDhcpClient *self, const char *iface, const char *reason) + else if (g_ascii_strcasecmp(reason, "nak") == 0 || g_ascii_strcasecmp(reason, "expire") == 0 + || g_ascii_strcasecmp(reason, "expire6") == 0) + return NM_DHCP_STATE_EXPIRE; +- else if (g_ascii_strcasecmp(reason, "end") == 0) ++ else if (g_ascii_strcasecmp(reason, "end") == 0 || g_ascii_strcasecmp(reason, "stop") == 0 ++ || g_ascii_strcasecmp(reason, "stopped") == 0) + return NM_DHCP_STATE_DONE; + else if (g_ascii_strcasecmp(reason, "fail") == 0 || g_ascii_strcasecmp(reason, "abend") == 0) + return NM_DHCP_STATE_FAIL; ++ else if (g_ascii_strcasecmp(reason, "preinit") == 0) ++ return NM_DHCP_STATE_NOOP; + + _LOGD("unmapped DHCP state '%s'", reason); + return NM_DHCP_STATE_UNKNOWN; +@@ -547,6 +550,18 @@ nm_dhcp_client_watch_child(NMDhcpClient *self, pid_t pid) + priv->watch_id = g_child_watch_add(pid, daemon_watch_cb, self); + } + ++void ++nm_dhcp_client_stop_watch_child(NMDhcpClient *self, pid_t pid) ++{ ++ NMDhcpClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE(self); ++ ++ g_return_if_fail(priv->pid == pid); ++ priv->pid = -1; ++ ++ watch_cleanup(self); ++ timeout_cleanup(self); ++} ++ + gboolean + nm_dhcp_client_start_ip4(NMDhcpClient *self, + GBytes * client_id, +@@ -874,6 +889,9 @@ nm_dhcp_client_handle_event(gpointer unused, + state_to_string(new_state), + reason); + ++ if (new_state == NM_DHCP_STATE_NOOP) ++ return TRUE; ++ + if (NM_IN_SET(new_state, NM_DHCP_STATE_BOUND, NM_DHCP_STATE_EXTENDED)) { + GVariantIter iter; + const char * name; +diff --git a/src/dhcp/nm-dhcp-client.h b/src/dhcp/nm-dhcp-client.h +index 05faa9ea5..46446849a 100644 +--- a/src/dhcp/nm-dhcp-client.h ++++ b/src/dhcp/nm-dhcp-client.h +@@ -55,6 +55,7 @@ typedef enum { + NM_DHCP_STATE_EXPIRE, /* lease expired or NAKed */ + NM_DHCP_STATE_FAIL, /* failed for some reason */ + NM_DHCP_STATE_TERMINATED, /* client is no longer running */ ++ NM_DHCP_STATE_NOOP, /* state is a non operation for NetworkManager */ + __NM_DHCP_STATE_MAX, + NM_DHCP_STATE_MAX = __NM_DHCP_STATE_MAX - 1, + } NMDhcpState; +@@ -183,6 +184,8 @@ void nm_dhcp_client_start_timeout(NMDhcpClient *self); + + void nm_dhcp_client_watch_child(NMDhcpClient *self, pid_t pid); + ++void nm_dhcp_client_stop_watch_child(NMDhcpClient *self, pid_t pid); ++ + void nm_dhcp_client_set_state(NMDhcpClient *self, + NMDhcpState new_state, + NMIPConfig * ip_config, +diff --git a/src/dhcp/nm-dhcp-dhcpcd.c b/src/dhcp/nm-dhcp-dhcpcd.c +index b2b5d28bd..7cb003859 100644 +--- a/src/dhcp/nm-dhcp-dhcpcd.c ++++ b/src/dhcp/nm-dhcp-dhcpcd.c +@@ -1,6 +1,6 @@ + /* SPDX-License-Identifier: GPL-2.0+ */ + /* +- * Copyright (C) 2008 Roy Marples ++ * Copyright (C) 2008,2020 Roy Marples <roy@marples.name> + * Copyright (C) 2010 Dan Williams <dcbw@redhat.com> + */ + +@@ -40,7 +40,6 @@ static GType nm_dhcp_dhcpcd_get_type(void); + /*****************************************************************************/ + + typedef struct { +- char * pid_file; + NMDhcpListener *dhcp_listener; + } NMDhcpDhcpcdPrivate; + +@@ -71,39 +70,37 @@ ip4_start(NMDhcpClient *client, + const char * last_ip4_address, + GError ** error) + { +- NMDhcpDhcpcd * self = NM_DHCP_DHCPCD(client); +- NMDhcpDhcpcdPrivate *priv = NM_DHCP_DHCPCD_GET_PRIVATE(self); +- gs_unref_ptrarray GPtrArray *argv = NULL; +- pid_t pid = -1; +- GError * local = NULL; +- gs_free char * cmd_str = NULL; +- gs_free char * binary_name = NULL; ++ NMDhcpDhcpcd * self = NM_DHCP_DHCPCD(client); ++ gs_unref_ptrarray GPtrArray *argv = NULL; ++ pid_t pid; ++ GError * local; ++ gs_free char * cmd_str = NULL; + const char * iface; + const char * dhcpcd_path; + const char * hostname; + +- g_return_val_if_fail(priv->pid_file == NULL, FALSE); ++ pid = nm_dhcp_client_get_pid(client); ++ g_return_val_if_fail(pid == -1, FALSE); + + iface = nm_dhcp_client_get_iface(client); + +- /* dhcpcd does not allow custom pidfiles; the pidfile is always +- * RUNSTATEDIR "dhcpcd-<ifname>.pid". +- */ +- priv->pid_file = g_strdup_printf(RUNSTATEDIR "/dhcpcd-%s.pid", iface); +- + dhcpcd_path = nm_dhcp_dhcpcd_get_path(); + if (!dhcpcd_path) { + nm_utils_error_set_literal(error, NM_UTILS_ERROR_UNKNOWN, "dhcpcd binary not found"); + return FALSE; + } + +- /* Kill any existing dhcpcd from the pidfile */ +- binary_name = g_path_get_basename(dhcpcd_path); +- nm_dhcp_client_stop_existing(priv->pid_file, binary_name); +- + argv = g_ptr_array_new(); + g_ptr_array_add(argv, (gpointer) dhcpcd_path); + ++ /* Don't configure anything, we will do that instead. ++ * This requires dhcpcd-9.3.3 or newer. ++ * Older versions only had an option not to install a default route, ++ * dhcpcd still added addresses and other routes so we no longer support that ++ * as it doesn't fit how NetworkManager wants to work. ++ */ ++ g_ptr_array_add(argv, (gpointer) "--noconfigure"); ++ + g_ptr_array_add(argv, (gpointer) "-B"); /* Don't background on lease (disable fork()) */ + + g_ptr_array_add(argv, (gpointer) "-K"); /* Disable built-in carrier detection */ +@@ -113,8 +110,6 @@ ip4_start(NMDhcpClient *client, + /* --noarp. Don't request or claim the address by ARP; this also disables IPv4LL. */ + g_ptr_array_add(argv, (gpointer) "-A"); + +- g_ptr_array_add(argv, (gpointer) "-G"); /* Let NM handle routing */ +- + g_ptr_array_add(argv, (gpointer) "-c"); /* Set script file */ + g_ptr_array_add(argv, (gpointer) nm_dhcp_helper_path); + +@@ -146,8 +141,8 @@ ip4_start(NMDhcpClient *client, + if (!g_spawn_async(NULL, + (char **) argv->pdata, + NULL, +- G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_STDOUT_TO_DEV_NULL +- | G_SPAWN_STDERR_TO_DEV_NULL, ++ G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL ++ | G_SPAWN_DO_NOT_REAP_CHILD, + nm_utils_setpgid, + NULL, + &pid, +@@ -169,23 +164,32 @@ ip4_start(NMDhcpClient *client, + static void + stop(NMDhcpClient *client, gboolean release) + { +- NMDhcpDhcpcd * self = NM_DHCP_DHCPCD(client); +- NMDhcpDhcpcdPrivate *priv = NM_DHCP_DHCPCD_GET_PRIVATE(self); +- int errsv; +- +- NM_DHCP_CLIENT_CLASS(nm_dhcp_dhcpcd_parent_class)->stop(client, release); +- +- if (priv->pid_file) { +- if (remove(priv->pid_file) == -1) { +- errsv = errno; +- _LOGD("could not remove dhcp pid file \"%s\": %d (%s)", +- priv->pid_file, +- errsv, +- nm_strerror_native(errsv)); +- } ++ NMDhcpDhcpcd *self = NM_DHCP_DHCPCD(client); ++ pid_t pid; ++ int sig, errsv; ++ ++ pid = nm_dhcp_client_get_pid(client); ++ sig = release ? SIGALRM : SIGTERM; ++ _LOGD("sending %s to dhcpcd pid %d", sig == SIGALRM ? "SIGALRM" : "SIGTERM", pid); ++ ++ /* dhcpcd-9.x features privilege separation. ++ * It's not our job to track all these processes so we rely on dhcpcd ++ * to always cleanup after itself. ++ * Because it also re-parents itself to PID 1, the process cannot be ++ * reaped or waited for. ++ * As such, just send the correct signal. ++ */ ++ if (kill(pid, sig) == -1) { ++ errsv = errno; ++ _LOGE("failed to kill dhcpcd %d:%s", errsv, strerror(errsv)); + } + +- /* FIXME: implement release... */ ++ /* When this function exits NM expects the PID to be -1. ++ * This means we also need to stop watching the pid. ++ * If we need to know the exit status then we need to refactor NM ++ * to allow a non -1 to mean we're waiting to exit still. ++ */ ++ nm_dhcp_client_stop_watch_child(client, pid); + } + + /*****************************************************************************/ +@@ -214,8 +218,6 @@ dispose(GObject *object) + g_clear_object(&priv->dhcp_listener); + } + +- nm_clear_g_free(&priv->pid_file); +- + G_OBJECT_CLASS(nm_dhcp_dhcpcd_parent_class)->dispose(object); + } + +-- +2.30.0 + diff --git a/net-misc/networkmanager/networkmanager-1.28.0.ebuild b/net-misc/networkmanager/networkmanager-1.28.0-r1.ebuild index 58a738efe185..f4c0c507020b 100644 --- a/net-misc/networkmanager/networkmanager-1.28.0.ebuild +++ b/net-misc/networkmanager/networkmanager-1.28.0-r1.ebuild @@ -45,7 +45,7 @@ COMMON_DEPEND=" net-dns/dnsmasq[dbus,dhcp] net-firewall/iptables ) dhclient? ( >=net-misc/dhcp-4[client] ) - dhcpcd? ( net-misc/dhcpcd ) + dhcpcd? ( >=net-misc/dhcpcd-9.3.3 ) elogind? ( >=sys-auth/elogind-219 ) introspection? ( >=dev-libs/gobject-introspection-0.10.3:= ) modemmanager? ( >=net-misc/modemmanager-0.7.991:0= @@ -100,6 +100,10 @@ BDEPEND=" ) " +PATCHES=( + "${FILESDIR}/${PN}-1.28.0-dhcpcd9.patch" +) + python_check_deps() { if use introspection; then has_version "dev-python/pygobject:3[${PYTHON_USEDEP}]" || return |