summaryrefslogtreecommitdiff
path: root/src/technology.c
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2011-09-02 13:34:58 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2011-09-12 11:40:49 +0200
commit415f6cd5afdbfbd87e508026a2b04b744c997548 (patch)
treeda8d07100b6c5ad41345eb8de325f0cc29c4aa76 /src/technology.c
parentc50cb7e7fbc92fb2c58ec730bbaacf6e0b5e2601 (diff)
downloadconnman-415f6cd5afdbfbd87e508026a2b04b744c997548.tar.gz
connman-415f6cd5afdbfbd87e508026a2b04b744c997548.tar.bz2
connman-415f6cd5afdbfbd87e508026a2b04b744c997548.zip
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.
Diffstat (limited to 'src/technology.c')
-rw-r--r--src/technology.c13
1 files 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,