All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gprs: Deactivate old contexts on attach
@ 2016-04-04 16:11 Alfonso Sanchez-Beato
  2016-04-04 19:48 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Alfonso Sanchez-Beato @ 2016-04-04 16:11 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 855 bytes --]

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.
---
 src/gprs.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gprs.c b/src/gprs.c
index 3acb412..3a4a819 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -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;
 	}
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gprs: Deactivate old contexts on attach
  2016-04-04 16:11 [PATCH] gprs: Deactivate old contexts on attach Alfonso Sanchez-Beato
@ 2016-04-04 19:48 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2016-04-04 19:48 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 409 bytes --]

Hi Alfonso,

On 04/04/2016 11:11 AM, Alfonso Sanchez-Beato wrote:
> 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.
> ---
>   src/gprs.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>

Applied, thanks.

Regards,
-Denis


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-04 19:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-04 16:11 [PATCH] gprs: Deactivate old contexts on attach Alfonso Sanchez-Beato
2016-04-04 19:48 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.