From 3bf7d114fe860e1827e6eb111ba9c8d9d2672a86 Mon Sep 17 00:00:00 2001 From: hyunuktak Date: Thu, 1 Sep 2016 19:06:26 +0900 Subject: [PATCH] Fix the bracket properly Change-Id: I001c6e3069f10e668840e401c7b09d09b2b97597 Signed-off-by: hyunuktak --- packaging/net-config.spec | 2 +- src/wifi-power.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packaging/net-config.spec b/packaging/net-config.spec index 0aba72d..330d86e 100755 --- a/packaging/net-config.spec +++ b/packaging/net-config.spec @@ -1,6 +1,6 @@ Name: net-config Summary: TIZEN Network Configuration service -Version: 1.1.85 +Version: 1.1.86 Release: 2 Group: System/Network License: Apache-2.0 diff --git a/src/wifi-power.c b/src/wifi-power.c index 5705b69..0b23f24 100755 --- a/src/wifi-power.c +++ b/src/wifi-power.c @@ -1083,9 +1083,9 @@ static int __netconfig_get_random_mac(unsigned char *mac_buf, int mac_len) void __netconfig_set_ether_macaddr() { - DBG("Set wired Mac address "); char *mac_addr = NULL; + char rand_addr[WLAN_MAC_ADDR_MAX]; int rv = -1; mac_addr = vconf_get_str(VCONF_ETH_MAC_ADDRESS); @@ -1099,7 +1099,7 @@ void __netconfig_set_ether_macaddr() /*Generate the Random Mac address*/ unsigned char rand_mac_add[ETH_MAC_ADDR_SIZE+1]; - if (__netconfig_get_random_mac(rand_mac_add, ETH_MAC_ADDR_SIZE == -1)) { + if (__netconfig_get_random_mac(rand_mac_add, ETH_MAC_ADDR_SIZE) == -1) { ERR("Could not generate the Random Mac address"); g_free(mac_addr); @@ -1110,18 +1110,18 @@ void __netconfig_set_ether_macaddr() rand_mac_add[0] |= 0x02; /*set local assignment bit*/ /*Set the Mac address in Vconf*/ - snprintf(mac_addr, WLAN_MAC_ADDR_MAX, "%x:%x:%x:%x:%x:%x", + snprintf(rand_addr, WLAN_MAC_ADDR_MAX, "%x:%x:%x:%x:%x:%x", rand_mac_add[0], rand_mac_add[1], rand_mac_add[2], rand_mac_add[3], rand_mac_add[4], rand_mac_add[5]); - netconfig_set_vconf_str(VCONF_ETH_MAC_ADDRESS, mac_addr); + netconfig_set_vconf_str(VCONF_ETH_MAC_ADDRESS, rand_addr); } - DBG("MAC Address of eth0 [%s]", mac_addr); + DBG("MAC Address of eth0 [%s]", rand_addr); const char *path = NET_EXEC_PATH; char *const args[] = { "/sbin/ifconfig", "eth0", "hw", - "ether", mac_addr, "up", NULL}; + "ether", rand_addr, "up", NULL}; char *const envs[] = { NULL }; rv = netconfig_execute_file(path, args, envs); -- 2.34.1