mirror of git://git.sysmocom.de/ofono
gprs: Deactivate old contexts on attach
In some cases it is possible that a context is opened after a detach event has been received, and right before an attach, depending on the modem. We make sure that those contexts are removed to keep consistency.
This commit is contained in:
parent
31d2dfcfbe
commit
154f4aca65
|
@ -1624,6 +1624,12 @@ static void gprs_attached_update(struct ofono_gprs *gprs)
|
|||
release_active_contexts(gprs);
|
||||
gprs->bearer = -1;
|
||||
} else if (have_active_contexts(gprs) == TRUE) {
|
||||
/*
|
||||
* Some times the context activates after a detach event and
|
||||
* right before an attach. We close it to avoid unexpected open
|
||||
* contexts.
|
||||
*/
|
||||
release_active_contexts(gprs);
|
||||
gprs->flags |= GPRS_FLAG_ATTACHED_UPDATE;
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue