From 7fb4bf5d5165ca6642eab6f3b52bd38fcadb8dbf Mon Sep 17 00:00:00 2001 From: Alexandre Bard Date: Tue, 19 Nov 2019 15:20:00 +0100 Subject: [PATCH] networkmanager: Add patch: reactivate GSM connection when MM reconnects After a disconnection from network side, ModemManager can reconnect 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 --- ...onnections-when-ModemManager-reconne.patch | 61 +++++++++++++++++++ .../networkmanager/networkmanager_%.bbappend | 1 + 2 files changed, 62 insertions(+) create mode 100644 recipes-connectivity/networkmanager/networkmanager/0001-Reactivate-GSM-connections-when-ModemManager-reconne.patch diff --git a/recipes-connectivity/networkmanager/networkmanager/0001-Reactivate-GSM-connections-when-ModemManager-reconne.patch b/recipes-connectivity/networkmanager/networkmanager/0001-Reactivate-GSM-connections-when-ModemManager-reconne.patch new file mode 100644 index 0000000..a009a1b --- /dev/null +++ b/recipes-connectivity/networkmanager/networkmanager/0001-Reactivate-GSM-connections-when-ModemManager-reconne.patch @@ -0,0 +1,61 @@ +From f7c129b1775e35f603c1c58c12f958ae81ae6bb8 Mon Sep 17 00:00:00 2001 +From: Alexandre Bard +Date: Wed, 13 Nov 2019 17:53:54 +0100 +Subject: [PATCH] Reactivate GSM connections when ModemManager reconnects by + itself + +After a disconnection from network side, ModemManager can reconnect +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 +--- + src/devices/wwan/nm-device-modem.c | 8 +++++--- + src/nm-policy.c | 5 +++++ + 2 files changed, 10 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); + } + +- 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); ++ ++ /* 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); + ++ /* Reset retries count */ ++ reset_autoconnect_all(self, device, FALSE); + schedule_activate_check (self, device); + } + +-- +2.20.1 + diff --git a/recipes-connectivity/networkmanager/networkmanager_%.bbappend b/recipes-connectivity/networkmanager/networkmanager_%.bbappend index 1c06d9e..14b0a5b 100644 --- a/recipes-connectivity/networkmanager/networkmanager_%.bbappend +++ b/recipes-connectivity/networkmanager/networkmanager_%.bbappend @@ -5,6 +5,7 @@ SRC_URI_append = "\ file://system-connections.tar.gz \ file://NetworkManager.conf \ file://00-fallback-dns.conf \ + file://0001-Reactivate-GSM-connections-when-ModemManager-reconne.patch \ "