From: Seonah Moon Date: Wed, 16 Nov 2016 10:37:25 +0000 (+0900) Subject: Reset changed mac address after finishing tethering X-Git-Tag: submit/tizen/20161125.052705~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=283d3bde59aff21597fe4d0d81b76fbb714ef662;p=platform%2Fcore%2Fapi%2Ftethering.git Reset changed mac address after finishing tethering Change-Id: Ife8e3db52a073f9ff86edbb6a35b6183fa8c8ebb Signed-off-by: Seonah Moon --- diff --git a/include/tethering_private.h b/include/tethering_private.h index 1f753e8..9613f8d 100644 --- a/include/tethering_private.h +++ b/include/tethering_private.h @@ -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; diff --git a/packaging/capi-network-tethering.spec b/packaging/capi-network-tethering.spec index 56554d5..3375e45 100644 --- a/packaging/capi-network-tethering.spec +++ b/packaging/capi-network-tethering.spec @@ -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 diff --git a/src/tethering.c b/src/tethering.c index f3780d8..d568ade 100755 --- a/src/tethering.c +++ b/src/tethering.c @@ -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; }