Use p2p interface name from configuration file 17/161317/1 accepted/tizen/4.0/unified/20171123.184204 submit/tizen_4.0/20171122.230705
authorJiung <jiung.yu@samsung.com>
Wed, 22 Nov 2017 08:51:03 +0000 (17:51 +0900)
committertaesub kim <taesub.kim@samsung.com>
Wed, 22 Nov 2017 22:54:15 +0000 (07:54 +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 63fc052..3d3e357 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 dff4228..446a1e4 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);