Add a file path to check mac address 14/102214/1
authorhyunuktak <hyunuk.tak@samsung.com>
Mon, 5 Dec 2016 07:49:14 +0000 (16:49 +0900)
committerhyunuktak <hyunuk.tak@samsung.com>
Mon, 5 Dec 2016 07:49:16 +0000 (16:49 +0900)
Change-Id: Icfdeae25d767ec140739a599771a9d2895cf3d70
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
packaging/net-config.spec
src/utils/util.c

index b3b5b00..01b2f00 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          net-config
 Summary:       TIZEN Network Configuration service
-Version:       1.1.95
+Version:       1.1.96
 Release:       2
 Group:         System/Network
 License:       Apache-2.0
index 8376291..f1c42f4 100755 (executable)
@@ -46,6 +46,7 @@
 #define DBUS_SERVICE_DBUS              "org.freedesktop.DBus"
 #define DBUS_INTERFACE_DBUS            "org.freedesktop.DBus"
 #define MAC_INFO_FILEPATH              tzplatform_mkpath(TZ_SYS_ETC, "/.mac.info")
+#define MAC_ADDRESS_FILEPATH   "/sys/class/net/wlan0/address"
 #define MAC_ADDRESS_MAX_LEN            18
 
 static gboolean netconfig_device_picker_test = FALSE;
@@ -1054,7 +1055,11 @@ void netconfig_set_mac_address_from_file(void)
        file = fopen(MAC_INFO_FILEPATH, "r");
        if (file == NULL) {
                ERR("Fail to open %s", MAC_INFO_FILEPATH);
-               return;
+               file = fopen(MAC_ADDRESS_FILEPATH, "r");
+               if (file == NULL) {
+                       ERR("Fail to open %s", MAC_ADDRESS_FILEPATH);
+                       return;
+               }
        }
        if (fgets(mac_str, sizeof(mac_str), file) == NULL) {
                ERR("Fail to read mac address");