- DBG("enabled %d", tethering_enabled + 1);
-
- if (g_atomic_int_exchange_and_add(&tethering_enabled, 1) == 0) {
- err = enable_bridge(BRIDGE_NAME);
- if (err < 0)
- return;
-
- tethering_dhcp_server =
- dhcp_server_start(BRIDGE_NAME,
- BRIDGE_IP, BRIDGE_SUBNET,
- BRIDGE_IP_START, BRIDGE_IP_END,
- 24 * 3600, BRIDGE_DNS);
- if (tethering_dhcp_server == NULL) {
- disable_bridge(BRIDGE_NAME);
- return;
- }
-
- enable_nat(default_interface);
-
- DBG("tethering started");
- }