Hi Leena,

On Fri, Dec 17, 2010 at 03:22:14PM +0530, [email protected] wrote:
> Below is patch for:
> http://bugs.meego.com/show_bug.cgi?id=10454
> http://bugs.meego.com/show_bug.cgi?id=11201
> 
> When ConnMan is SIGKILLed and restarted WiFi plugin will reuse the existing 
> interface. It will get a list of existing BSSs and for each BSS in the BSSs 
> list, interface_bss_added() is called. In interface_bss_added() if there is a 
> next DBusMessageIter iterator and if it is valid, it is assumed that the next 
> iterator would contain the key/value pairs for the BSS properties and 
> bss_property is invoked. But for the BSSs list the next iterator contains the 
> object path of next BSS in the list. As a result we get no properties for the 
> BSS and a GSupplicantNetwork is created with empty ssid etc. 
> 
> Also for the BSSs list, supplicant_dbus_array_foreach() is invoked with 
> interface_bss_added() as callback. In interface_bss_added() the iter is moved 
> to the next iterator. Now supplicant_dbus_array_foreach() again moves the 
> iterator to next after the callback is invoked. As a result we end up moving 
> the iterator twice and miss adding few BSS from the BSSs list. And hence the 
> bug.
> 
> interface_bss_added() is called with BSS followed by its properties only from 
> signal_bss_added(). Whereas for CurrentBSS and BSSs list GetAll D-Bus method 
> is invoked for fetching the BSS's properties.
> 
> Separating the cases of BSS's being added with and without properties will 
> fix the issue.
> 
I smell some long debugging session here :) Thanks a lot for that.
The patch makes sense to me, but I wonder if something like:


diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 42f4920..b30dce5 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -1170,7 +1170,8 @@ static void interface_bss_added(DBusMessageIter *iter, 
void *user_data)
        bss->path = g_strdup(path);
 
        dbus_message_iter_next(iter);
-       if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_INVALID) {
+       if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_INVALID &&
+               dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_OBJECT_PATH) {
                supplicant_dbus_property_foreach(iter, bss_property, bss);
                bss_property(NULL, NULL, bss);
                return;


I may be missing something here though, feel free to point me at it.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to