From 7006d18550a39f6b4c313ed736378b20da044404 Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Fri, 10 Feb 2017 03:23:15 +0100 Subject: [PATCH] [PATCH netdev: Don't generate disconnect event in netdev_free As discussed previously there's no point in having device.c change state to autoconnect when device_remove will be called next. --- src/netdev.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/netdev.c b/src/netdev.c index edb38539..0d1af510 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -371,10 +371,9 @@ static void netdev_free(void *data) l_timeout_remove(netdev->neighbor_report_timeout); } - if (netdev->connected) { - netdev->result = NETDEV_RESULT_ABORTED; - netdev_connect_failed(NULL, netdev); - } else if (netdev->disconnect_cmd_id) { + if (netdev->connected) + netdev_connect_free(netdev); + else if (netdev->disconnect_cmd_id) { l_genl_family_cancel(nl80211, netdev->disconnect_cmd_id); netdev->disconnect_cmd_id = 0;