diff options
author | Alfonso Sanchez-Beato <alfonso.sanchez-beato@canonical.com> | 2016-04-04 18:11:48 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2016-04-04 14:48:05 -0500 |
commit | 154f4aca65b3b419239be75d0def276bd7f4dc8e (patch) | |
tree | 9561ac100e6f3b4455b1a7d3cd49a427aaf0b6e4 /src/gprs.c | |
parent | 31d2dfcfbed952bef0130a80356b081e184ea255 (diff) | |
download | ofono-154f4aca65b3b419239be75d0def276bd7f4dc8e.tar.gz |
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.
Diffstat (limited to 'src/gprs.c')
-rw-r--r-- | src/gprs.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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; } |