From: Marcel Holtmann Date: Mon, 13 Apr 2009 14:03:31 +0000 (+0200) Subject: Remove gateway from list when switching connections X-Git-Tag: accepted/2.0alpha-wayland/20121110.002834~3881 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=97555b09dfe9af258eda343373837c0c88d54475;p=profile%2Fivi%2Fconnman.git Remove gateway from list when switching connections --- diff --git a/src/connection.c b/src/connection.c index 79890dc..62d6a31 100644 --- a/src/connection.c +++ b/src/connection.c @@ -63,6 +63,17 @@ static struct gateway_data *find_gateway(int index, const char *gateway) return NULL; } +static void remove_gateway(int index, const char *gateway) +{ + struct gateway_data *data; + + data = find_gateway(index, gateway); + if (data == NULL) + return; + + gateway_list = g_slist_remove(gateway_list, data); +} + static int set_route(struct connman_element *element, const char *gateway) { struct ifreq ifr; @@ -512,6 +523,8 @@ static void connection_remove(struct connman_element *element) if (gateway == NULL) return; + remove_gateway(element->index, gateway); + connman_element_set_enabled(element, FALSE); emit_default_signal(element);