diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-04-13 16:03:31 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-04-13 16:03:31 +0200 |
commit | 97555b09dfe9af258eda343373837c0c88d54475 (patch) | |
tree | 992922d5cafd0d12218276b99ba403ef8871030f | |
parent | 81d9a32d97f33764969acc5e39a80ad9836ec6b7 (diff) | |
download | connman-97555b09dfe9af258eda343373837c0c88d54475.tar.gz connman-97555b09dfe9af258eda343373837c0c88d54475.tar.bz2 connman-97555b09dfe9af258eda343373837c0c88d54475.zip |
Remove gateway from list when switching connections
-rw-r--r-- | src/connection.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/connection.c b/src/connection.c index 79890dc3..62d6a31d 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); |