netdev: Clear connect_cb when connected

Prevents situations like this:
src/device.c:device_enter_state() Old State: connecting, new state:
connected
src/scan.c:scan_periodic_stop() Stopping periodic scan for ifindex: 3
src/device.c:device_dbus_disconnect()
src/device.c:device_connect_cb() 3
src/device.c:device_disassociated() 3
src/device.c:device_enter_state() Old State: connected, new state:
autoconnect
This commit is contained in:
Denis Kenzior 2016-08-04 10:46:41 -05:00
parent cec2104ffa
commit 8248c1c7d2
1 changed files with 3 additions and 1 deletions

View File

@ -532,8 +532,10 @@ static void netdev_operstate_cb(bool success, void *user_data)
return;
}
if (netdev->connect_cb)
if (netdev->connect_cb) {
netdev->connect_cb(netdev, NETDEV_RESULT_OK, netdev->user_data);
netdev->connect_cb = NULL;
}
}
static void netdev_setting_keys_failed(struct netdev *netdev,