Hi:
I have done some investigation on bug 
1558(https://bugzilla.moblin.org/show_bug.cgi?id=1558), and found the root 
cause of the bug is that when remove the connection, ConnMan does not remove 
the gateway from gateway_list, so next time enable the connection, the gateway 
is thought has been set, so the Route table can be set properly, that causes 
the network can not work. I have worked out a patch to fix the bug. 
Please review it. Any comments are welcome. 

diff --git a/src/connection.c b/src/connection.c
index 79890dc..8da8012 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -499,7 +499,7 @@ done:
 static void connection_remove(struct connman_element *element)
 {
        const char *gateway = NULL;
-
+       struct gateway_data *data;
        DBG("element %p name %s", element, element->name);
 
        unregister_interface(element);
@@ -511,7 +511,12 @@ static void connection_remove(struct connman_element 
*element)
 
        if (gateway == NULL)
                return;
-
+       
+       data = find_gateway(element->index, gateway);
+       if (data == NULL)
+               return;
+       gateway_list = g_slist_remove(gateway_list, data);
+       
        connman_element_set_enabled(element, FALSE);
        emit_default_signal(element);

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

Reply via email to