aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-08-04 14:13:45 +0200
committerAleksander Morgado <aleksander@aleksander.es>2020-08-12 11:36:21 +0000
commit16e3bb892d25e3cb7796889082943b073924a695 (patch)
tree9953fce997f2884e6cb8a85f6d03d9b63ee00ada
parent2f684ce92ea9cc772a36db2e7bd9d48e677d3935 (diff)
iface-modem: avoid connection status flapping if briefly unregistered
If the modem is connected and we receive indications of a quick unregistration cycle (i.e. unregistered, then registered again) we should not end up flagging the modem as disconnected. We already had some logic to avoid this with the "deferred 3GPP unregistration" logic in the base bearer object, but this logic only took into account the status of the bearer, not the status of the modem. Wed Jul 29 15:35:44 2020 daemon.info [1567]: <info> Modem /org/freedesktop/ModemManager1/Modem/0: 3GPP Registration state changed (home -> idle) Wed Jul 29 15:35:44 2020 daemon.debug [1567]: <debug> Modem /org/freedesktop/ModemManager1/Modem/0: 3GPP location updated (MCC: '0', MNC: '0', Location area code: '0', Tracking area code: '1CE8', Cell ID: '68F832') Wed Jul 29 15:35:44 2020 daemon.debug [1567]: <debug> Connected bearer not registered in 3GPP network Wed Jul 29 15:35:44 2020 daemon.info [1567]: <info> Modem /org/freedesktop/ModemManager1/Modem/0: state changed (connected -> enabled) Wed Jul 29 15:35:44 2020 daemon.debug [1567]: <debug> Modem /org/freedesktop/ModemManager1/Modem/0: signal quality updated (0) Wed Jul 29 15:35:44 2020 daemon.debug [1567]: <debug> Modem /org/freedesktop/ModemManager1/Modem/0: access technology changed (lte -> unknown) Wed Jul 29 15:35:44 2020 daemon.debug [1567]: <debug> Periodic signal checks disabled Wed Jul 29 15:35:44 2020 daemon.info [1567]: <info> Modem /org/freedesktop/ModemManager1/Modem/0: 3GPP Registration state changed (idle -> registering) Wed Jul 29 15:35:44 2020 daemon.debug [1567]: <debug> Modem /org/freedesktop/ModemManager1/Modem/0: 3GPP location updated (MCC: '0', MNC: '0', Location area code: '0', Tracking area code: '1C84', Cell ID: 'A3E050') Wed Jul 29 15:35:44 2020 daemon.debug [1567]: <debug> Modem /org/freedesktop/ModemManager1/Modem/0: 3GPP location updated (MCC: '238', MNC: '1', Location area code: '0', Tracking area code: '1C84', Cell ID: 'A3E050') Wed Jul 29 15:35:44 2020 daemon.info [1567]: <info> Modem /org/freedesktop/ModemManager1/Modem/0: 3GPP Registration state changed (registering -> home) Wed Jul 29 15:35:44 2020 daemon.info [1567]: <info> Modem /org/freedesktop/ModemManager1/Modem/0: state changed (enabled -> registered) We now try to improve this situation by also considering the case where modem is supposed to get into "enabled" state (i.e. not registered, not searching), but we still consider the amount of connected bearers to decide the final state reported by the modem. In other words, a modem with the 3GPP registration reported as 'idle' will still be reported as 'connected' if there is at least one bearer in connected state. This situation will end as soon as the 'deferred 3GPP unregistration' timeout expires, as that will force the bearer to be disconnected.
-rw-r--r--src/mm-iface-modem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
index 9b3f2223..8a4a00af 100644
--- a/src/mm-iface-modem.c
+++ b/src/mm-iface-modem.c
@@ -1509,7 +1509,8 @@ __iface_modem_update_state_internal (MMIfaceModem *self,
/* While connected we don't want registration status changes to change
* the modem's state away from CONNECTED. */
- if ((new_state == MM_MODEM_STATE_SEARCHING ||
+ if ((new_state == MM_MODEM_STATE_ENABLED ||
+ new_state == MM_MODEM_STATE_SEARCHING ||
new_state == MM_MODEM_STATE_REGISTERED) &&
bearer_list &&
old_state > MM_MODEM_STATE_REGISTERED) {