supplicant: Handle race condition on WiFi dongle removal
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 9 Nov 2012 08:54:20 +0000 (10:54 +0200)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Tue, 13 Nov 2012 12:37:45 +0000 (14:37 +0200)
commit0fb7d1f43b653a9057cdd35a42b4bc766655e72d
tree1ac119fd5ea63a9839908535a133a0699493495c
parent3170b704fe7cc56a5e89439f632f1b7ba35e7602
supplicant: Handle race condition on WiFi dongle removal

When a WiFi USB dongle is removed, both rtnl and wpa_supplicant will
be telling that the device is gone. While disconnecting and removing
an interface via gsupplicant, check that D-Bus doesn't give us an
error indicating the interface is already unregistered from D-Bus.

The gdb output looks like:
 (gdb) where
 #0  0x0042247c in network_connect (network=0x2) at plugins/wifi.c:1197
 #1  0x004228f0 in disconnect_callback (result=<value optimized out>,
 interface=0x0, user_data=0x99) at plugins/wifi.c:1254
 #2  0x0042b910 in network_remove_result (error=0x4d5458
 "org.freedesktop.DBus.Error.UnknownMethod", iter=<value optimized
 out>,
     user_data=<value optimized out>) at gsupplicant/supplicant.c:3593
 #3  0x0042ede0 in method_call_reply (call=0x4c6fd0,
 user_data=0x4d3be8) at gsupplicant/dbus.c:386
 #4  0x2abfddb4 in complete_pending_call_and_unlock () from
 /usr/lib/libdbus-1.so.3

Also don't call the same callback twice.
gsupplicant/supplicant.c