Call wfd_util_get_local_dev_mac after assigning g_manager 98/172098/3 accepted/tizen/unified/20180320.141335 submit/tizen/20180318.231541 submit/tizen/20180320.043504
authorJiung <jiung.yu@samsung.com>
Mon, 12 Mar 2018 00:35:08 +0000 (09:35 +0900)
committerJiung <jiung.yu@samsung.com>
Mon, 12 Mar 2018 00:49:57 +0000 (09:49 +0900)
Description : Setting interface address logic is also removed
because there's case which can't be covered by this.
And it seems no longer needed because it's used for avoiding
confusion of event which is raised by wpasupplicant socket interface

Change-Id: Iacab4513bf718711a7263d1f71fd47846c04ebd4
Signed-off-by: Yu jiung <jiung.yu@samsung.com>
packaging/wifi-direct-manager.spec
src/wifi-direct-event.c
src/wifi-direct-manager.c

index d49a2268a4a4d7250261c048de3803d8e9d6dcb0..61169308960f819ef08f244ebfba2e6e3fba1b4f 100644 (file)
@@ -6,7 +6,7 @@
 
 Name:          wifi-direct-manager
 Summary:       Wi-Fi Direct manger
-Version:       1.2.267
+Version:       1.2.268
 Release:       1
 Group:      Network & Connectivity/Wireless
 License:    Apache-2.0
index 9248b6109a1cddc0276eccb075704e895c59e21b..da165cb34b7482d026d3ee1d914116b9e4973f87 100644 (file)
@@ -1036,13 +1036,6 @@ void wfd_event_sta_connected(wfd_oem_event_s *event)
        wfd_device_s *peer = NULL;
        char peer_mac_address[MACSTR_LEN+1] = {0, };
 
-       /* FIXME: Move this code to plugin */
-       if (!memcmp(event->intf_addr, manager->local->intf_addr, MACADDR_LEN)) {
-               WDS_LOGD("Ignore this event");//LCOV_EXCL_LINE
-               __WDS_LOG_FUNC_EXIT__;//LCOV_EXCL_LINE
-               return;
-       }
-
        if (ISZEROMACADDR(event->dev_addr)) {
                WDS_LOGD("Legacy Peer Connected [Peer: " MACSTR "]", MAC2STR(event->intf_addr));
 
index b71e2885536d660b51923532e846a80e54aef9f0..d0d07f941dc5b81a4bc8ae3e974c1a16fdeebea6 100644 (file)
@@ -195,15 +195,6 @@ static int _wfd_local_init_device(wfd_manager_s *manager)
        WDS_LOGD("Local Device name [%s]", local->dev_name);
        wfd_util_set_dev_name_notification();
 
-       res = wfd_util_get_local_dev_mac(local->dev_addr);
-       if (res < 0)
-               WDS_LOGE("Failed to get local device MAC address");//LCOV_EXCL_LINE
-
-       memcpy(local->intf_addr, local->dev_addr, MACADDR_LEN);
-       local->intf_addr[4] ^= 0x80;
-       WDS_LOGD("Local Interface MAC address [" MACSECSTR "]",
-                                       MAC2SECSTR(local->intf_addr));
-
        local->config_methods = WFD_WPS_MODE_PBC | WFD_WPS_MODE_DISPLAY | WFD_WPS_MODE_KEYPAD;
        local->wps_mode = WFD_WPS_MODE_PBC;
        local->services = NULL;
@@ -316,26 +307,6 @@ int wfd_local_get_dev_mac(char *dev_mac)
        return 0;
 }
 
-#if 0
-int wfd_local_get_intf_mac(unsigned char *intf_mac)
-{
-       __WDS_LOG_FUNC_ENTER__;//LCOV_EXCL_LINE
-       wfd_device_s *local = g_manager->local;
-
-       if (!intf_mac) {
-               WDS_LOGE("Invalid parameter");//LCOV_EXCL_LINE
-               __WDS_LOG_FUNC_EXIT__;//LCOV_EXCL_LINE
-               return -1;
-       }
-
-       g_snprintf(intf_mac, MACSTR_LEN, MACSTR, MAC2STR(local->intf_addr));
-       WDS_SECLOGD("Local interface MAC address [%s]", intf_mac);
-
-       __WDS_LOG_FUNC_EXIT__;//LCOV_EXCL_LINE
-       return 0;
-}
-#endif
-
 int wfd_local_get_ip_addr(char *ip_str)
 {
        __WDS_LOG_FUNC_ENTER__;//LCOV_EXCL_LINE
@@ -663,11 +634,6 @@ int wfd_manager_activate(wfd_manager_s *manager)
        if (res < 0)
                WDS_LOGE("Failed to get local device MAC address");//LCOV_EXCL_LINE
 
-       memcpy(manager->local->intf_addr, manager->local->dev_addr, MACADDR_LEN);
-       manager->local->intf_addr[4] ^= 0x80;
-       WDS_LOGD("Local Interface MAC address [" MACSECSTR "]",
-                                       MAC2SECSTR(manager->local->intf_addr));
-
        __WDS_LOG_FUNC_EXIT__;//LCOV_EXCL_LINE
        return WIFI_DIRECT_ERROR_NONE;
 }
@@ -1785,6 +1751,7 @@ int wfd_manager_deinit(wfd_manager_s *manager)
 
 int wfd_manager_load()
 {
+       int res = 0;
        __WDS_LOG_FUNC_ENTER__;//LCOV_EXCL_LINE
 
        /* TODO: Parsing argument */
@@ -1801,6 +1768,10 @@ int wfd_manager_load()
        }
        WDS_LOGD("Succeeded to initialize manager");//LCOV_EXCL_LINE
 
+       res = wfd_util_get_local_dev_mac(g_manager->local->dev_addr);
+       if (res < 0)
+               WDS_LOGE("Failed to get local device MAC address");//LCOV_EXCL_LINE
+
        if (wfd_manager_iface_init() != 0) {
                WDS_LOGE("Failed to initialize iface");//LCOV_EXCL_LINE
                wfd_manager_deinit(g_manager);