Use p2p interface name from configuration file 46/161246/2 accepted/tizen/unified/20171123.065835 submit/tizen/20171122.230844
authorJiung <jiung.yu@samsung.com>
Wed, 22 Nov 2017 08:51:03 +0000 (17:51 +0900)
committerJiung <jiung.yu@samsung.com>
Wed, 22 Nov 2017 08:52:26 +0000 (17:52 +0900)
Change-Id: I3b611f46621eb3c2a6df7b76a9bc61cabf612f37
Signed-off-by: Yu jiung <jiung.yu@samsung.com>
packaging/wifi-direct-manager.spec
plugin/wpasupplicant/ctrl_iface_dbus/wfd-plugin-wpasupplicant.c

index 63fc0521e942d954d2dedb47e3b9596014073e9f..3d3e357a4608b2cce377d3691b4d1ec9ac76a13a 100644 (file)
@@ -6,7 +6,7 @@
 
 Name:          wifi-direct-manager
 Summary:       Wi-Fi Direct manger
-Version:       1.2.254
+Version:       1.2.255
 Release:       1
 Group:      Network & Connectivity/Wireless
 License:    Apache-2.0
index dff42288ed46b4fa6716422a109460211ae0d69a..446a1e4ad01af1af8ed0671d9fa35eb86662ebf3 100644 (file)
 #define NETCONFIG_DBUS_REPLY_TIMEOUT (10 * 1000)
 
 #define CONF_FILE_PATH tzplatform_mkpath(TZ_SYS_ETC, "wpa_supplicant/wpa_supplicant.conf")
-
-#ifndef DEFAULT_MAC_FILE_PATH
-#define DEFAULT_MAC_FILE_PATH "/sys/class/net/p2p0/address"
-#endif
+#define MAX_FILE_PATH_LEN 256
 
 static wfd_oem_ops_s supplicant_ops = {
        .configure = ws_configure,
@@ -580,13 +577,16 @@ static int _ws_get_local_dev_mac(unsigned char *dev_mac)
 {
        __WDP_LOG_FUNC_ENTER__;
        FILE *fd = NULL;
-       const char *file_path = DEFAULT_MAC_FILE_PATH;
+       char file_path[MAX_FILE_PATH_LEN] = {0, };
        char local_mac[OEM_MACSTR_LEN] = {0, };
        char *ptr = NULL;
        int res = 0;
        char error_buf[MAX_SIZE_ERROR_BUFFER] = {0, };
 
        errno = 0;
+       g_snprintf(file_path, sizeof(file_path),
+                       "/sys/class/net/%s/address", config->p2p_ifname);
+
        fd = fopen(file_path, "r");
        if (!fd) {
                strerror_r(errno, error_buf, MAX_SIZE_ERROR_BUFFER);