networkmanager: migrated reactivate gsm connections patch to kirkstone

Part of yocto upgrade from dunfell to kirkstone
Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
This commit is contained in:
Marc Mattmueller 2022-07-19 11:11:49 +00:00 committed by Alexandre Bard
parent ffe292ff47
commit 1e7b74e76c
1 changed files with 35 additions and 35 deletions

View File

@ -1,6 +1,6 @@
From f7c129b1775e35f603c1c58c12f958ae81ae6bb8 Mon Sep 17 00:00:00 2001
From 8558b348c92e276b586cfd502992c07679970085 Mon Sep 17 00:00:00 2001
From: Alexandre Bard <alexandre.bard@netmodule.com>
Date: Wed, 13 Nov 2019 17:53:54 +0100
Date: Mon, 18 Jul 2022 17:06:03 +0200
Subject: [PATCH] Reactivate GSM connections when ModemManager reconnects by
itself
@ -9,51 +9,51 @@ itself if the modem requests it. This commit makes sure that a
reconnection of the modem makes the GSM connection active in NM.
BugzID: 60029
Signed-off-by: Alexandre Bard <alexandre.bard@netmodule.com>
---
src/devices/wwan/nm-device-modem.c | 8 +++++---
src/nm-policy.c | 5 +++++
2 files changed, 10 insertions(+), 3 deletions(-)
src/core/devices/wwan/nm-device-modem.c | 7 ++++---
src/core/nm-policy.c | 5 +++++
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c
index 1e3162808..f03818599 100644
--- a/src/devices/wwan/nm-device-modem.c
+++ b/src/devices/wwan/nm-device-modem.c
@@ -360,9 +360,11 @@ modem_state_cb (NMModem *modem,
nm_device_recheck_available_connections (device);
}
diff --git a/src/core/devices/wwan/nm-device-modem.c b/src/core/devices/wwan/nm-device-modem.c
index ef802a44f2..9914f2b33a 100644
--- a/src/core/devices/wwan/nm-device-modem.c
+++ b/src/core/devices/wwan/nm-device-modem.c
@@ -308,9 +308,10 @@ modem_state_cb(NMModem *modem, int new_state_i, int old_state_i, gpointer user_d
nm_device_recheck_available_connections(device);
}
- nm_device_queue_recheck_available (device,
- NM_DEVICE_STATE_REASON_MODEM_AVAILABLE,
- NM_DEVICE_STATE_REASON_MODEM_FAILED);
+ nm_device_recheck_available_connections (device);
+
+ if (new_state == NM_MODEM_STATE_CONNECTED)
+ nm_device_emit_recheck_auto_activate(device);
- nm_device_queue_recheck_available(device,
- NM_DEVICE_STATE_REASON_MODEM_AVAILABLE,
- NM_DEVICE_STATE_REASON_MODEM_FAILED);
+ nm_device_recheck_available_connections(device);
+
+ if (new_state == NM_MODEM_STATE_CONNECTED)
+ nm_device_emit_recheck_auto_activate(device);
}
static void
diff --git a/src/nm-policy.c b/src/nm-policy.c
index 1faba5c7b..02088bb6e 100644
--- a/src/nm-policy.c
+++ b/src/nm-policy.c
@@ -1019,6 +1019,9 @@ update_ip4_routing (NMPolicy *self, gboolean force_update)
nm_connection_get_id (nm_active_connection_get_applied_connection (best_ac)),
ip_iface);
_notify (self, PROP_DEFAULT_IP4_AC);
diff --git a/src/core/nm-policy.c b/src/core/nm-policy.c
index d77fc0a025..71dff18548 100644
--- a/src/core/nm-policy.c
+++ b/src/core/nm-policy.c
@@ -1075,6 +1075,9 @@ update_ip4_routing(NMPolicy *self, gboolean force_update)
nm_connection_get_id(nm_active_connection_get_applied_connection(best_ac)),
ip_iface);
_notify(self, PROP_DEFAULT_IP4_AC);
+
+ /* Recheck all connections to enable potential VPN depending on new route */
+ schedule_activate_all(self);
+ /* Recheck all connections to enable potential VPN depending on new route */
+ schedule_activate_all(self);
}
static void
@@ -2041,6 +2044,8 @@ device_recheck_auto_activate (NMDevice *device, gpointer user_data)
NMPolicyPrivate *priv = user_data;
NMPolicy *self = _PRIV_TO_SELF (priv);
@@ -2200,6 +2203,8 @@ device_recheck_auto_activate(NMDevice *device, gpointer user_data)
NMPolicyPrivate *priv = user_data;
NMPolicy *self = _PRIV_TO_SELF(priv);
+ /* Reset retries count */
+ reset_autoconnect_all(self, device, FALSE);
schedule_activate_check (self, device);
+ /* Reset retries count */
+ reset_autoconnect_all(self, device, FALSE);
schedule_activate_check(self, device);
}
--