From b265aa0b0c187cc660f3b3e1714d383132821c38 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Thu, 15 Nov 2012 10:50:15 +0100 Subject: ofono: Remove network if GPRS context is removed Whenever the GPRS contextext is removed we need also to remove the network object. Following sequence was observed: cm_update_attached() /huawei_1 Attached 1 modem_changed() /huawei_1 Interfaces 0x07 Plugin creates network object and registers it at core cm_update_attached() /huawei_1 Attached 0 service.c:run_auto_connect() set_property() /huawei_1 path /huawei_1/context1 org.ofono.ConnectionContext.Active Obviously, the context is not attached at this point so we get an Failed to change property: /huawei_1/context1 org.ofono.ConnectionContext.Active: org.ofono.Error.NotAttached GPRS is not attached Fixes BMC#25725 --- plugins/ofono.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins/ofono.c') diff --git a/plugins/ofono.c b/plugins/ofono.c index 2122b85d..41954e4e 100644 --- a/plugins/ofono.c +++ b/plugins/ofono.c @@ -1698,8 +1698,10 @@ static void cm_update_attached(struct modem_data *modem, DBG("%s Attached %d", modem->path, modem->attached); - if (modem->attached == FALSE) + if (modem->attached == FALSE) { + remove_network(modem); return; + } if (has_interface(modem->interfaces, OFONO_API_NETREG) == FALSE) { -- cgit v1.2.3