summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/network.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/network.c b/src/network.c
index 87a73e3c..1692e40a 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1220,6 +1220,15 @@ static void current_operator_callback(const struct ofono_error *error,
DBG("%p, %p", netreg, netreg->current_operator);
+ /*
+ * Sometimes we try to query COPS right when we roam off the cell,
+ * in which case the operator information frequently comes in bogus.
+ * We ignore it here
+ */
+ if (netreg->status != NETWORK_REGISTRATION_STATUS_REGISTERED &&
+ netreg->status != NETWORK_REGISTRATION_STATUS_ROAMING)
+ current = NULL;
+
if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
DBG("Error during current operator");
return;