diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-11-25 22:39:15 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-11-25 22:39:15 +0000 |
commit | d934827bf44b7cfcf6711964418148fa60877668 (patch) | |
tree | 0625f358789b5e015e49db139cc1dbc9be00428f /net-misc/networkmanager/files | |
parent | 2e34d110f164bf74d55fced27fe0000201b3eec5 (diff) |
gentoo resync : 25.11.2020
Diffstat (limited to 'net-misc/networkmanager/files')
4 files changed, 169 insertions, 172 deletions
diff --git a/net-misc/networkmanager/files/1.18.4-iwd1-compat.patch b/net-misc/networkmanager/files/1.18.4-iwd1-compat.patch deleted file mode 100644 index 12c8b873e6a1..000000000000 --- a/net-misc/networkmanager/files/1.18.4-iwd1-compat.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 59923ad85d1a1cf2216a4f14649702d24d3f2360 Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel <lkundrak@v3.sk> -Date: Sat, 2 Nov 2019 06:55:54 +0100 -Subject: [PATCH 1/2] iwd: add some missing error handling - -g_dbus_object_manager_get_interface() can happily return NULL and we -need to check for that. ---- - src/devices/wifi/nm-iwd-manager.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/src/devices/wifi/nm-iwd-manager.c b/src/devices/wifi/nm-iwd-manager.c -index dd1cad480..e83f8063c 100644 ---- a/src/devices/wifi/nm-iwd-manager.c -+++ b/src/devices/wifi/nm-iwd-manager.c -@@ -136,6 +136,11 @@ agent_dbus_method_cb (GDBusConnection *connection, - network = g_dbus_object_manager_get_interface (priv->object_manager, - network_path, - NM_IWD_NETWORK_INTERFACE); -+ if (!network) { -+ _LOGE ("unable to find the network object"); -+ return; -+ } -+ - - device_path = get_property_string_or_null (G_DBUS_PROXY (network), "Device"); - if (!device_path) { -@@ -260,6 +265,11 @@ register_agent (NMIwdManager *self) - "/", - NM_IWD_AGENT_MANAGER_INTERFACE); - -+ if (!agent_manager) { -+ _LOGE ("unable to register the IWD Agent: PSK/8021x Wi-Fi networks may not work"); -+ return; -+ } -+ - /* Register our agent */ - g_dbus_proxy_call (G_DBUS_PROXY (agent_manager), - "RegisterAgent", --- -2.20.1 - - -From 186d22a9634e2bf94658ed6f1cf2b332ecb3a32c Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel <lkundrak@v3.sk> -Date: Sat, 2 Nov 2019 07:01:28 +0100 -Subject: [PATCH 2/2] iwd: unbreak iwd-1.0 - -The upstream apparently thought it's a great idea to change the agent -manager path. This fixes things for those unfortunate enough to run -IWD. ---- - src/devices/wifi/nm-iwd-manager.c | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/src/devices/wifi/nm-iwd-manager.c b/src/devices/wifi/nm-iwd-manager.c -index e83f8063c..470cb1c90 100644 ---- a/src/devices/wifi/nm-iwd-manager.c -+++ b/src/devices/wifi/nm-iwd-manager.c -@@ -262,9 +262,17 @@ register_agent (NMIwdManager *self) - GDBusInterface *agent_manager; - - agent_manager = g_dbus_object_manager_get_interface (priv->object_manager, -- "/", -+ "/net/connman/iwd", - NM_IWD_AGENT_MANAGER_INTERFACE); - -+ if (!agent_manager) { -+ /* IWD prior to 1.0 dated 30 October, 2019 has the agent manager on a -+ * different path. */ -+ agent_manager = g_dbus_object_manager_get_interface (priv->object_manager, -+ "/", -+ NM_IWD_AGENT_MANAGER_INTERFACE); -+ } -+ - if (!agent_manager) { - _LOGE ("unable to register the IWD Agent: PSK/8021x Wi-Fi networks may not work"); - return; --- -2.20.1 - diff --git a/net-misc/networkmanager/files/init.d.NetworkManager-r1 b/net-misc/networkmanager/files/init.d.NetworkManager-r1 deleted file mode 100644 index 3209644c511f..000000000000 --- a/net-misc/networkmanager/files/init.d.NetworkManager-r1 +++ /dev/null @@ -1,58 +0,0 @@ -#!/sbin/openrc-run -# Copyright (c) 2008 Saleem Abdulrasool <compnerd@compnerd.org> -# Copyright 2013-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -description="NetworkManager daemon. The service is marked as started only \ -when a network connection is established." - -depend() { - need dbus - use consolekit - provide net -} - -start() { - # If we are re-called by a dispatcher event, we want to mark the service - # as started without starting the daemon again - yesno "${IN_BACKGROUND}" && return 0 - - [ -z "${INACTIVE_TIMEOUT}" ] && INACTIVE_TIMEOUT="1" - - ebegin "Starting NetworkManager" - start-stop-daemon --start --quiet --pidfile /run/NetworkManager/NetworkManager.pid \ - --exec /usr/sbin/NetworkManager -- --pid-file /run/NetworkManager/NetworkManager.pid - local _retval=$? - eend "${_retval}" - if [ "x${_retval}" = 'x0' ] && ! nm-online -t "${INACTIVE_TIMEOUT}"; then - einfo "Marking NetworkManager as inactive. It will automatically be marked" - einfo "as started after a network connection has been established." - mark_service_inactive - fi - return "${_retval}" -} - -stop() { - # If we are re-called by a dispatcher event, we want to mark the service - # as inactive without stopping the daemon - if yesno "${IN_BACKGROUND}"; then - mark_service_inactive "${SVCNAME}" - return 0 - fi - - ebegin "Stopping NetworkManager" - local pidfile=/run/NetworkManager/NetworkManager.pid - if [ ! -e "${pidfile}" ] && [ -e /var/run/NetworkManager.pid ]; then - # Try stopping the pid file used by <0.9.7 - pidfile=/var/run/NetworkManager.pid - start-stop-daemon --stop --quiet --pidfile "${pidfile}" - ret=$? - [ ${ret} = 0 ] && [ -e "${pidfile}" ] && rm "${pidfile}" - eend ${ret} - else - start-stop-daemon --stop --quiet --pidfile "${pidfile}" - eend $? - fi -} - -# vim: set ft=gentoo-init-d ts=4 : diff --git a/net-misc/networkmanager/files/networkmanager-1.26.4-iwd-fixes-pr640.patch b/net-misc/networkmanager/files/networkmanager-1.26.4-iwd-fixes-pr640.patch new file mode 100644 index 000000000000..b3b63758d697 --- /dev/null +++ b/net-misc/networkmanager/files/networkmanager-1.26.4-iwd-fixes-pr640.patch @@ -0,0 +1,169 @@ +Backport of https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/640 + +--- a/src/devices/wifi/nm-device-iwd.c ++++ b/src/devices/wifi/nm-device-iwd.c +@@ -1905,38 +1905,39 @@ schedule_periodic_scan (NMDeviceIwd *self, gboolean initial_scan) + { + NMDeviceIwdPrivate *priv = NM_DEVICE_IWD_GET_PRIVATE (self); + GVariant *value; +- gboolean disconnected; ++ gboolean disconnected = TRUE; + guint interval; + +- if (!priv->can_scan || priv->scan_requested) +- return; +- +- value = g_dbus_proxy_get_cached_property (priv->dbus_station_proxy, "State"); +- disconnected = nm_streq0 (get_variant_state (value), "disconnected"); +- g_variant_unref (value); ++ if (priv->can_scan) { ++ value = g_dbus_proxy_get_cached_property (priv->dbus_station_proxy, "State"); ++ disconnected = nm_streq0 (get_variant_state (value), "disconnected"); ++ g_variant_unref (value); ++ } + + /* Start scan immediately after a disconnect, mode change or +- * device UP, otherwise wait a period dependent on the current +- * state. ++ * device UP, otherwise wait 10 seconds. When connected, update ++ * AP list mainly on UI requests. + * + * (initial_scan && disconnected) override priv->scanning below + * because of an IWD quirk where a device will often be in the + * autoconnect state and scanning at the time of our initial_scan, +- * but our logic will the send it a Disconnect() causeing IWD to ++ * but our logic will then send it a Disconnect() causing IWD to + * exit autoconnect and interrupt the ongoing scan, meaning that + * we still want a new scan ASAP. + */ +- if (initial_scan && disconnected) ++ if (!priv->can_scan || !disconnected || priv->scan_requested || priv->scanning) ++ interval = -1; ++ else if (initial_scan) + interval = 0; +- else if (!priv->periodic_scan_id && !priv->scanning) +- interval = disconnected ? 10 : 20; ++ else if (!priv->periodic_scan_id) ++ interval = 10; + else + return; + + nm_clear_g_source (&priv->periodic_scan_id); +- priv->periodic_scan_id = g_timeout_add_seconds (interval, +- periodic_scan_timeout_cb, +- self); ++ ++ if (interval != (guint) -1) ++ priv->periodic_scan_id = g_timeout_add_seconds (interval, periodic_scan_timeout_cb, self); + } + + static void +@@ -2331,7 +2332,6 @@ powered_changed (NMDeviceIwd *self, gboolean new_powered) + update_aps (self); + } else { + set_can_scan (self, FALSE); +- nm_clear_g_source (&priv->periodic_scan_id); + priv->scanning = FALSE; + priv->scan_requested = FALSE; + priv->can_connect = FALSE; +@@ -2537,17 +2537,7 @@ dispose (GObject *object) + + nm_clear_g_cancellable (&priv->cancellable); + +- nm_clear_g_source (&priv->periodic_scan_id); +- +- cleanup_association_attempt (self, TRUE); +- +- g_clear_object (&priv->dbus_device_proxy); +- g_clear_object (&priv->dbus_station_proxy); +- g_clear_object (&priv->dbus_ap_proxy); +- g_clear_object (&priv->dbus_adhoc_proxy); +- g_clear_object (&priv->dbus_obj); +- +- remove_all_aps (self); ++ nm_device_iwd_set_dbus_object(self, NULL); + + G_OBJECT_CLASS (nm_device_iwd_parent_class)->dispose (object); + +--- a/src/devices/wifi/nm-iwd-manager.c ++++ b/src/devices/wifi/nm-iwd-manager.c +@@ -622,6 +622,38 @@ interface_removed (GDBusObjectManager *object_manager, GDBusObject *object, + } + } + ++static void ++object_added(GDBusObjectManager *object_manager, GDBusObject *object, gpointer user_data) ++{ ++ GList *interfaces, *iter; ++ ++ interfaces = g_dbus_object_get_interfaces(object); ++ ++ for (iter = interfaces; iter; iter = iter->next) { ++ GDBusInterface *interface = G_DBUS_INTERFACE(iter->data); ++ ++ interface_added(NULL, object, interface, user_data); ++ } ++ ++ g_list_free_full(interfaces, g_object_unref); ++} ++ ++static void ++object_removed(GDBusObjectManager *object_manager, GDBusObject *object, gpointer user_data) ++{ ++ GList *interfaces, *iter; ++ ++ interfaces = g_dbus_object_get_interfaces(object); ++ ++ for (iter = interfaces; iter; iter = iter->next) { ++ GDBusInterface *interface = G_DBUS_INTERFACE(iter->data); ++ ++ interface_removed(NULL, object, interface, user_data); ++ } ++ ++ g_list_free_full(interfaces, g_object_unref); ++} ++ + static void + connection_removed (NMSettings *settings, + NMSettingsConnection *sett_conn, +@@ -682,22 +714,6 @@ _om_has_name_owner (GDBusObjectManager *object_manager) + return !!name_owner; + } + +-static void +-object_added (NMIwdManager *self, GDBusObject *object) +-{ +- GList *interfaces, *iter; +- +- interfaces = g_dbus_object_get_interfaces (object); +- +- for (iter = interfaces; iter; iter = iter->next) { +- GDBusInterface *interface = G_DBUS_INTERFACE (iter->data); +- +- interface_added (NULL, object, interface, self); +- } +- +- g_list_free_full (interfaces, g_object_unref); +-} +- + static void + release_object_manager (NMIwdManager *self) + { +@@ -836,12 +852,16 @@ got_object_manager (GObject *object, GAsyncResult *result, gpointer user_data) + G_CALLBACK (interface_added), self); + g_signal_connect (priv->object_manager, "interface-removed", + G_CALLBACK (interface_removed), self); ++ g_signal_connect (priv->object_manager, "object-added", ++ G_CALLBACK(object_added), self); ++ g_signal_connect (priv->object_manager, "object-removed", ++ G_CALLBACK(object_removed), self); + + g_hash_table_remove_all (priv->known_networks); + + objects = g_dbus_object_manager_get_objects (object_manager); + for (iter = objects; iter; iter = iter->next) +- object_added (self, G_DBUS_OBJECT (iter->data)); ++ object_added (NULL, G_DBUS_OBJECT(iter->data), self); + + g_list_free_full (objects, g_object_unref); + diff --git a/net-misc/networkmanager/files/networkmanager-data-fix-the-ID_NET_DRIVER-udev-rule.patch b/net-misc/networkmanager/files/networkmanager-data-fix-the-ID_NET_DRIVER-udev-rule.patch deleted file mode 100644 index 1b94ab478d8b..000000000000 --- a/net-misc/networkmanager/files/networkmanager-data-fix-the-ID_NET_DRIVER-udev-rule.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 27d380b70ea839c7badab420361e4e65e023e8e9 Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel <lkundrak@v3.sk> -Date: Fri, 16 Aug 2019 13:22:09 +0200 -Subject: [PATCH] data: fix the ID_NET_DRIVER udev rule - -Systemd v243 is complaining about the wrong substitution there. That is -sort of harmless, because systemd-udevd in that version doesn't need the -rule anyway. But still fix it, to avoid a warning. - -Also, newer udevd's $PATH doesn't include sbin. That is also okay, -because we don't need the rule to actually work there. But fix it -anyway. - -https://bugzilla.redhat.com/show_bug.cgi?id=1740655 ---- - data/84-nm-drivers.rules | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/data/84-nm-drivers.rules b/data/84-nm-drivers.rules -index d246ef6ce..e398cb9f2 100644 ---- a/data/84-nm-drivers.rules -+++ b/data/84-nm-drivers.rules -@@ -7,6 +7,6 @@ ACTION!="add|change", GOTO="nm_drivers_end" - # Determine ID_NET_DRIVER if there's no ID_NET_DRIVER or DRIVERS (old udev?) - ENV{ID_NET_DRIVER}=="?*", GOTO="nm_drivers_end" - DRIVERS=="?*", GOTO="nm_drivers_end" --PROGRAM="/bin/sh -c 'ethtool -i $1 | sed -n s/^driver:\ //p' -- $env{INTERFACE}", RESULT=="?*", ENV{ID_NET_DRIVER}="%c" -+PROGRAM="/bin/sh -c '/usr/sbin/ethtool -i $$1 |/usr/bin/sed -n s/^driver:\ //p' -- $env{INTERFACE}", ENV{ID_NET_DRIVER}="%c" - - LABEL="nm_drivers_end" --- -2.21.0 - |