[MM] [PATCH] broadband-bearer: fix cid check in disconnect_3gpp



A value 0 is used to denote an invalid/uninitialized CID. This patch
fixes a CID check in disconnect_3gpp() of MMBroadbandBearer such that it
disables all PDP contexts via AT+CGACT=0 when no specific CID is used
(i.e. cid == 0).
---
 src/mm-broadband-bearer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mm-broadband-bearer.c b/src/mm-broadband-bearer.c
index 292420c..193f44a 100644
--- a/src/mm-broadband-bearer.c
+++ b/src/mm-broadband-bearer.c
@@ -1508,7 +1508,7 @@ disconnect_3gpp (MMBroadbandBearer *self,
                                            user_data);
 
     /* If no specific CID was used, disable all PDP contexts */
-    ctx->cgact_command = (cid >= 0 ?
+    ctx->cgact_command = (cid > 0 ?
                           g_strdup_printf ("+CGACT=0,%d", cid) :
                           g_strdup_printf ("+CGACT=0"));
 
-- 
1.8.2.1



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]