diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2010-11-14 01:51:52 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-11-14 01:51:52 +0100 |
commit | 0f3bee7b91cfe3efe87cf5d3fa9285d37206fd40 (patch) | |
tree | d5381d5c6902cdda6db57454290a66e2d9e39a95 /src/tethering.c | |
parent | 4c055d2726cd428c34c1debbe4126d07ef9e6db9 (diff) | |
download | connman-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.c | 6 |
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; |