[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.
This commit is contained in:
Andrew Zaborowski 2017-02-10 03:23:15 +01:00 committed by Denis Kenzior
parent 2ab67a1ee3
commit 7006d18550
1 changed files with 3 additions and 4 deletions

View File

@ -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;