From 415f6cd5afdbfbd87e508026a2b04b744c997548 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Fri, 2 Sep 2011 13:34:58 +0300 Subject: technology: Disable tethering only when no technology is tethering When notifying that a technology is not tethering anymore, go through the list of technologies and disable tethering only if no other technology is tethering. --- src/technology.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/technology.c b/src/technology.c index f8891b8d..82146175 100644 --- a/src/technology.c +++ b/src/technology.c @@ -154,6 +154,8 @@ static void tethering_changed(struct connman_technology *technology) void connman_technology_tethering_notify(struct connman_technology *technology, connman_bool_t enabled) { + GSList *list; + DBG("technology %p enabled %u", technology, enabled); if (technology->tethering == enabled) @@ -165,8 +167,15 @@ void connman_technology_tethering_notify(struct connman_technology *technology, if (enabled == TRUE) __connman_tethering_set_enabled(); - else - __connman_tethering_set_disabled(); + else { + for (list = technology_list; list; list = list->next) { + struct connman_technology *other_tech = list->data; + if (other_tech->tethering == TRUE) + break; + } + if (list == NULL) + __connman_tethering_set_disabled(); + } } static int set_tethering(struct connman_technology *technology, -- cgit v1.2.3