From: Patrik Flykt <[email protected]>
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 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/technology.c b/src/technology.c
index 9549a2b..9e229d6 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,
--
1.7.2.5
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman