Hi Marcel:

Bug1118(https://bugzilla.moblin.org/show_bug.cgi?id=1118) is a show stop issue 
and need to fix right away, so I spent some time to work out a patch to fix it.
The patch now is maintained in RPM package.

I found the issue comes from:
connman inserts unmodified "identifier" to harsh table to identify the network 
(see src/device.c connman_device_add_network())
However,
next time connman will used modified(using '_' substitute "none number and 
letter" char) "identifier" to search the hash table, so the registered network 
will be registered second time. (at src/device.c connman_device_get_network())

I find that the network->element->name is modified. Why we need to modify the 
name?

I think there are two methods to fix the issue, one is to add 
network->element->name to harsh table to identify the network, the other one is 
use unmodified "identifier" to search harsh table. I prefer the last one. Below 
is the patch.

Can you let me know you comments? :)

Further question, what if the two AP has the same essid? I think the same essid 
leads to the same identify and may cause the same issue with bug 1118. What do 
you think of it?


diff -Nurp connman-0.11-orig/src/device.c connman-0.11/src/device.c
--- connman-0.11-orig/src/device.c 2009-03-06 13:33:10.000000000 +0800
+++ connman-0.11/src/device.c   2009-03-06 13:34:28.000000000 +0800
@@ -1451,28 +1451,8 @@ int connman_device_add_network(struct co
 struct connman_network *connman_device_get_network(struct connman_device 
*device,
                         const char *identifier)
 {
-   struct connman_network *network;
-   char *temp;
-   unsigned int i;
-
    DBG("device %p identifier %s", device, identifier);
-
-   temp = g_strdup(identifier);
-   if (temp == NULL)
-      return NULL;
-
-   for (i = 0; i < strlen(temp); i++) {
-      char tmp = temp[i];
-      if ((tmp < '0' || tmp > '9') && (tmp < 'A' || tmp > 'Z') &&
-                    (tmp < 'a' || tmp > 'z'))
-          temp[i] = '_';
-   }
-
-   network = g_hash_table_lookup(device->networks, temp);
-
-   g_free(temp);
-
-   return network;
+   return g_hash_table_lookup(device->networks, identifier);
 }

_______________________________________________
connman mailing list
[email protected]
https://lists.moblin.org/mailman/listinfo/connman

Reply via email to