Hi Richard, On 7/24/19 12:02 PM, [email protected] wrote:
From: Richard Röjfors <[email protected]>In case the gprs_netreg_update is called from somewhere else than the actual netreg update before any netreg updates have happened. It can not make proper decisions. For instance we might run on EUTRAN but it does not know yet. So check if the technology is known to netreg, if not just return since netreg will kick us when its finished initialising, which will be very soon. --- src/gprs.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gprs.c b/src/gprs.c index bdb8c8a2..4e79c528 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -1660,6 +1660,16 @@ static void gprs_netreg_removed(struct ofono_gprs *gprs) static void gprs_netreg_update(struct ofono_gprs *gprs) { ofono_bool_t attach; + int technology; + + technology = ofono_netreg_get_technology(gprs->netreg); + + /* If we are called before netreg has updated us, just return + * we will get called again when the technology is available + * and we can make better decisions + */ + if (technology == -1) + return;
You have to be careful here, some modem drivers do not report technology at all, and it is an optional property in the API. So you are probably breaking such drivers with this change...
attach = gprs->netreg_status == NETWORK_REGISTRATION_STATUS_REGISTERED;
<snip> Regards, -Denis _______________________________________________ ofono mailing list [email protected] https://lists.ofono.org/mailman/listinfo/ofono
