ofono: Don't set network index when device is removed
authorYu A Wang <arron.wang@intel.com>
Thu, 10 Nov 2011 05:08:34 +0000 (00:08 -0500)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 18 Nov 2011 18:46:46 +0000 (19:46 +0100)
A NULL interface means the device is removed so there is no need for
setting the network index as it will eventually be removed.
Setting the network index to -1 prevents wpad or wispr to unreference
the service.

Fixes BMC#23979

plugins/ofono.c

index 95bb612..bcb79ae 100644 (file)
@@ -753,10 +753,6 @@ static void update_ipv4_settings(DBusMessageIter *array,
                                                netmask, gateway);
        }
 
-       /* deactive, oFono send NULL inteface before deactive signal */
-       if (interface == NULL)
-               connman_network_set_index(info->network, -1);
-
        g_free(address);
        g_free(netmask);
        g_free(gateway);
@@ -833,10 +829,6 @@ static void update_ipv6_settings(DBusMessageIter *array,
        connman_ipaddress_set_ipv6(&info->ipv6_address, address,
                                                prefix_length, gateway);
 
-       /* deactive, oFono send NULL inteface before deactive signal */
-       if (interface == NULL)
-               connman_network_set_index(info->network, -1);
-
        g_free(address);
        g_free(gateway);
 }