supplicant: Check for network before removing it
authorSamuel Ortiz <sameo@linux.intel.com>
Wed, 3 Nov 2010 16:44:33 +0000 (17:44 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Wed, 3 Nov 2010 17:08:32 +0000 (18:08 +0100)
When disconnecting by removing a network, check that the targeted network
is the one currently set.

plugins/supplicant.c

index 469e109..f0d1a4f 100644 (file)
@@ -2538,6 +2538,9 @@ int supplicant_disconnect(struct connman_network *network)
        if (task->disconnecting == TRUE)
                return -EALREADY;
 
+       if (task->network != network)
+               return -EINVAL;
+
        remove_network(task);
 
        disconnect_network(task);