summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4e8243e)
Change-Id: I001c6e3069f10e668840e401c7b09d09b2b97597
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
Name: net-config
Summary: TIZEN Network Configuration service
Name: net-config
Summary: TIZEN Network Configuration service
Release: 2
Group: System/Network
License: Apache-2.0
Release: 2
Group: System/Network
License: Apache-2.0
void __netconfig_set_ether_macaddr()
{
void __netconfig_set_ether_macaddr()
{
DBG("Set wired Mac address ");
char *mac_addr = NULL;
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);
int rv = -1;
mac_addr = vconf_get_str(VCONF_ETH_MAC_ADDRESS);
/*Generate the Random Mac address*/
unsigned char rand_mac_add[ETH_MAC_ADDR_SIZE+1];
/*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);
ERR("Could not generate the Random Mac address");
g_free(mac_addr);
rand_mac_add[0] |= 0x02; /*set local assignment bit*/
/*Set the Mac address in Vconf*/
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]);
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",
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);
char *const envs[] = { NULL };
rv = netconfig_execute_file(path, args, envs);