The network needs to be set disconnected in the callback as the pointer
will be unconditionally cleared in the function. Even with a result of
zero the interface_state() cannot be relied on; it might not be called
by gsupplicant/wpa_supplicant in all cases.
Reported by Thomas Green.
---
plugins/wifi.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 0588a9f..d2051a1 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -2099,9 +2099,10 @@ static void disconnect_callback(int result,
GSupplicantInterface *interface,
* we wont receive G_SUPPLICANT_STATE_DISCONNECTED since it
* failed, call connman_network_set_connected to report
* disconnect is completed.
+ * Also, since wifi->network is set to NULL, a later
+ * interface_state() cannot proceed with updating the state.
*/
- if (result < 0)
- connman_network_set_connected(wifi->network, false);
+ connman_network_set_connected(wifi->network, false);
}
wifi->network = NULL;
--
2.1.4
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman