[PATCH] bearer-qmi: fix incorrect use of mm_base_bearer_get_status

Ben Chan benchan at chromium.org
Tue Jan 24 07:07:57 UTC 2017


This patch fixes a bug in packet_service_status_indication_cb(), which
incorrectly treats the MMBearerStatus enum value returned by
mm_base_bearer_get_status() as a MMBearerConnectionStatus enum value.
MMBearerStatus and MMBearerConnectionStatus can't be used
interchangeably as they have different enum values for the
'disconnected' and 'disconnecting' state.
---
 src/mm-bearer-qmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mm-bearer-qmi.c b/src/mm-bearer-qmi.c
index a886ef96..72f2de4b 100644
--- a/src/mm-bearer-qmi.c
+++ b/src/mm-bearer-qmi.c
@@ -771,11 +771,11 @@ packet_service_status_indication_cb (QmiClientWds *client,
             &connection_status,
             NULL,
             NULL)) {
-        MMBearerConnectionStatus bearer_status = mm_base_bearer_get_status (MM_BASE_BEARER (self));
+        MMBearerStatus bearer_status = mm_base_bearer_get_status (MM_BASE_BEARER (self));
 
         if (connection_status == QMI_WDS_CONNECTION_STATUS_DISCONNECTED &&
-            bearer_status != MM_BEARER_CONNECTION_STATUS_DISCONNECTED &&
-            bearer_status != MM_BEARER_CONNECTION_STATUS_DISCONNECTING) {
+            bearer_status != MM_BEARER_STATUS_DISCONNECTED &&
+            bearer_status != MM_BEARER_STATUS_DISCONNECTING) {
             QmiWdsCallEndReason cer;
             QmiWdsVerboseCallEndReasonType verbose_cer_type;
             gint16 verbose_cer_reason;
-- 
2.11.0.483.g087da7b7c-goog



More information about the ModemManager-devel mailing list