Clean up IPv6 network information during terminating tethering 16/183416/1 accepted/tizen/unified/20180711.132733 submit/tizen/20180709.014423
authorSeonah Moon <seonah1.moon@samsung.com>
Thu, 5 Jul 2018 07:32:08 +0000 (16:32 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Thu, 5 Jul 2018 07:51:06 +0000 (16:51 +0900)
Change-Id: Ie386219f47b940eb9393e3a80ffbef918d787b73

packaging/mobileap-agent.spec
src/mobileap_network.c

index f1c666e..65eeeef 100644 (file)
@@ -1,6 +1,6 @@
 Name: mobileap-agent
 Summary: Mobile AP daemon for setting tethering environments
-Version: 1.0.123
+Version: 1.0.124
 Release: 1
 Group: System/Network
 License: Apache-2.0
index 72d1fe1..d563e32 100644 (file)
@@ -1251,6 +1251,33 @@ static int __update_ipv6_network_info(void)
        return MOBILE_AP_ERROR_NONE;
 }
 
+static void __cleanup_ipv6_network_info(void)
+{
+       DBG("+");
+       if (ipv6_net_info.if_name) {
+               g_free(ipv6_net_info.if_name);
+               ipv6_net_info.if_name = NULL;
+       }
+
+       if (ipv6_net_info.global_address) {
+               g_free(ipv6_net_info.global_address);
+               ipv6_net_info.global_address = NULL;
+       }
+
+       if (ipv6_net_info.prefix) {
+               g_free(ipv6_net_info.prefix);
+               ipv6_net_info.prefix = NULL;
+       }
+
+       if (ipv6_net_info.dns) {
+               g_free(ipv6_net_info.dns);
+               ipv6_net_info.dns = NULL;
+       }
+
+       ipv6_net_info.state = 0;
+       DBG("-");
+}
+
 static int __enable_ipv4_forwarding(void)
 {
        int fd = -1;
@@ -1503,6 +1530,7 @@ void _close_ipv6_network(void)
        connection_profile_destroy(tethered_prof);
        tethered_prof = NULL;
        __close_tethering_profile();
+       __cleanup_ipv6_network_info();
 
        DBG("-\n");
        return;