summaryrefslogtreecommitdiff
path: root/src/tethering.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2010-11-14 01:51:52 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2010-11-14 01:51:52 +0100
commit0f3bee7b91cfe3efe87cf5d3fa9285d37206fd40 (patch)
treed5381d5c6902cdda6db57454290a66e2d9e39a95 /src/tethering.c
parent4c055d2726cd428c34c1debbe4126d07ef9e6db9 (diff)
downloadconnman-0f3bee7b91cfe3efe87cf5d3fa9285d37206fd40.tar.gz
connman-0f3bee7b91cfe3efe87cf5d3fa9285d37206fd40.tar.bz2
connman-0f3bee7b91cfe3efe87cf5d3fa9285d37206fd40.zip
tethering: Duplicate default interface string
Diffstat (limited to 'src/tethering.c')
-rw-r--r--src/tethering.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tethering.c b/src/tethering.c
index 6c15cc2e..8cbee09d 100644
--- a/src/tethering.c
+++ b/src/tethering.c
@@ -42,7 +42,7 @@
#define BRIDGE_DNS "8.8.8.8"
static connman_bool_t tethering_status = FALSE;
-static const char *default_interface = NULL;
+static char *default_interface = NULL;
static volatile gint tethering_enabled;
static GDHCPServer *tethering_dhcp_server = NULL;
@@ -327,7 +327,7 @@ void __connman_tethering_update_interface(const char *interface)
{
DBG("interface %s", interface);
- default_interface = interface;
+ g_free(default_interface);
if (interface == NULL) {
disable_nat(interface);
@@ -335,6 +335,8 @@ void __connman_tethering_update_interface(const char *interface)
return;
}
+ default_interface = g_strdup(interface);
+
if (tethering_status == FALSE ||
!g_atomic_int_get(&tethering_enabled))
return;