From 8248c1c7d2c10263d53c1d59c3c02f8b4479bd38 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 4 Aug 2016 10:46:41 -0500 Subject: [PATCH] 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 --- src/netdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/netdev.c b/src/netdev.c index 8fa712a9..b159f284 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -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,