Reset changed mac address after finishing tethering 80/98180/1
authorSeonah Moon <seonah1.moon@samsung.com>
Wed, 16 Nov 2016 10:37:25 +0000 (19:37 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Wed, 16 Nov 2016 10:37:40 +0000 (19:37 +0900)
Change-Id: Ife8e3db52a073f9ff86edbb6a35b6183fa8c8ebb
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
include/tethering_private.h
packaging/capi-network-tethering.spec
src/tethering.c

index 1f753e8..9613f8d 100644 (file)
@@ -291,6 +291,7 @@ typedef struct {
        bool port_forwarding;
        bool port_filtering;
        bool dhcp_enabled;
+       bool change_mac;
        int channel;
        int wifi_max_connected;
 } __tethering_h;
index 56554d5..3375e45 100644 (file)
@@ -1,6 +1,6 @@
 Name:          capi-network-tethering
 Summary:       Tethering Framework
-Version:       1.0.42
+Version:       1.0.43
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index f3780d8..d568ade 100755 (executable)
@@ -1369,6 +1369,7 @@ API int tethering_create(tethering_h *tethering)
        th->channel = 6;
        th->mode_type = TETHERING_WIFI_MODE_TYPE_G;
        th->wifi_max_connected = TETHERING_WIFI_MAX_STA;
+       th->change_mac = false;
 
        if (__generate_initial_passphrase(th->passphrase,
                        sizeof(th->passphrase)) == 0) {
@@ -1442,9 +1443,17 @@ API int tethering_destroy(tethering_h tethering)
        _retvm_if(tethering == NULL, TETHERING_ERROR_INVALID_PARAMETER,
                        "parameter(tethering) is NULL\n");
 
+       GVariant *result = NULL;
        __tethering_h *th = (__tethering_h *)tethering;
 
        DBG("Tethering Handle : 0x%X\n", th);
+
+       if (th->change_mac) {
+               result = g_dbus_proxy_call_sync(th->client_bus_proxy, "reset_mac", NULL,
+                               G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
+               g_variant_unref(result);
+       }
+
        __disconnect_signals(tethering);
 
        if (th->ssid)
@@ -3463,6 +3472,8 @@ API int tethering_wifi_change_mac(tethering_h tethering, char *mac)
 
        g_variant_unref(parameters);
 
+       th->change_mac = true;
+
        return TETHERING_ERROR_NONE;
 }