When tethering is enabled, remove the network associated with
this gadget device. Removing the network will in turn remove
the corresponding gadget service. Thus no gadget services
are visible when tethering has been enabled.
This is an identical change as commit
fa3ab75e6fcbc579c310673c7c40dad1ad7ff22b regarding ethernet.
---
plugins/gadget.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/plugins/gadget.c b/plugins/gadget.c
index 76633c6..94f6648 100644
--- a/plugins/gadget.c
+++ b/plugins/gadget.c
@@ -255,6 +255,15 @@ static void gadget_tech_enable_tethering(struct
connman_technology *technology,
for (list = cdc_interface_list; list; list = list->next) {
int index = GPOINTER_TO_INT(list->data);
+ struct connman_device *device =
+ connman_device_find_by_index(index);
+ struct gadget_data *gadget;
+
+ if (device) {
+ gadget = connman_device_get_data(device);
+ if (gadget)
+ remove_network(device, gadget);
+ }
connman_technology_tethering_notify(technology, true);
--
1.8.5.3
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman