From 97555b09dfe9af258eda343373837c0c88d54475 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 13 Apr 2009 16:03:31 +0200 Subject: [PATCH] Remove gateway from list when switching connections --- src/connection.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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); -- 1.7.9.5