summaryrefslogtreecommitdiff
path: root/src/tethering.c
diff options
context:
space:
mode:
authorYu A Wang <yu.a.wang@intel.com>2011-04-21 03:26:15 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2011-04-27 10:33:35 +0200
commit98604654bab317a39500dd7a4ab1705248d79f94 (patch)
treeec1ec715b9762b360a010ce118bda8b5f4e2e026 /src/tethering.c
parente41694929eaad433f9cb5af1a916af5b7a99eb98 (diff)
downloadconnman-98604654bab317a39500dd7a4ab1705248d79f94.tar.gz
connman-98604654bab317a39500dd7a4ab1705248d79f94.tar.bz2
connman-98604654bab317a39500dd7a4ab1705248d79f94.zip
tethering: Use tether device IP as tethering DNS server
Diffstat (limited to 'src/tethering.c')
-rw-r--r--src/tethering.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tethering.c b/src/tethering.c
index 3e4750d2..f7732c99 100644
--- a/src/tethering.c
+++ b/src/tethering.c
@@ -344,11 +344,15 @@ void __connman_tethering_set_enabled(void)
return;
}
+ if (__connman_dnsproxy_add_listener(BRIDGE_NAME) < 0)
+ connman_error("Can't add listener %s to DNS proxy",
+ BRIDGE_NAME);
+
tethering_dhcp_server =
dhcp_server_start(BRIDGE_NAME,
BRIDGE_IP, BRIDGE_SUBNET,
BRIDGE_IP_START, BRIDGE_IP_END,
- 24 * 3600, BRIDGE_DNS);
+ 24 * 3600, BRIDGE_IP);
if (tethering_dhcp_server == NULL) {
disable_bridge(BRIDGE_NAME);
remove_bridge(BRIDGE_NAME);
@@ -365,6 +369,8 @@ void __connman_tethering_set_disabled(void)
{
DBG("enabled %d", tethering_enabled - 1);
+ __connman_dnsproxy_remove_listener(BRIDGE_NAME);
+
if (g_atomic_int_dec_and_test(&tethering_enabled) == TRUE) {
disable_nat(default_interface);