base-bearer: ignore forced disconnections

If using PPP, ModemManager is never in charge of deciding when the
connection is finished, because that would end up making ModemManager
try to use the TTY port while pppd is still using it.

When the modem goes unregistered for some time, we should not force
the disconnection of the bearer object, we still need to wait for pppd
to tell us the modem is disconnected.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/331
This commit is contained in:
Aleksander Morgado
2021-03-12 17:44:44 +01:00
parent 952f416577
commit 3e58fbe547

View File

@@ -1325,6 +1325,11 @@ mm_base_bearer_disconnect_force (MMBaseBearer *self)
self->priv->status == MM_BEARER_STATUS_DISCONNECTED) self->priv->status == MM_BEARER_STATUS_DISCONNECTED)
return; return;
if (self->priv->ignore_disconnection_reports) {
mm_obj_dbg (self, "disconnection should be forced but it's explicitly ignored");
return;
}
mm_obj_dbg (self, "forcing disconnection"); mm_obj_dbg (self, "forcing disconnection");
/* If currently connecting, try to cancel that operation. */ /* If currently connecting, try to cancel that operation. */