Use the last updated MAC address before turning on wifi
[platform/upstream/connman.git] / src / device.c
index 89258ba..d0825ce 100755 (executable)
@@ -665,7 +665,7 @@ void connman_device_set_ident(struct connman_device *device,
                                                        const char *ident)
 {
 #ifdef TIZEN_EXT
-       if (device->ident)
+       if (device->ident && device->powered)
                return;
        else
 #endif
@@ -1112,7 +1112,7 @@ int connman_device_set_string(struct connman_device *device,
 
        if (g_str_equal(key, "Address")) {
 #ifdef TIZEN_EXT
-               if (device->address)
+               if (device->address && device->powered)
                        return 0;
                else
 #endif
@@ -1985,17 +1985,7 @@ struct connman_device *connman_device_create_from_index(int index)
        case CONNMAN_DEVICE_TYPE_ETHERNET:
        case CONNMAN_DEVICE_TYPE_GADGET:
        case CONNMAN_DEVICE_TYPE_WIFI:
-#if defined TIZEN_EXT
-               if (type == CONNMAN_DEVICE_TYPE_WIFI)
-                       name = _get_wifi_ident();
-               if (!name)
-#endif
                name = index2ident(index, "");
-#if defined TIZEN_EXT
-               if (type == CONNMAN_DEVICE_TYPE_WIFI)
-                       addr = _get_wifi_addr();
-               if (!addr)
-#endif
                addr = index2addr(index);
                break;
        case CONNMAN_DEVICE_TYPE_BLUETOOTH:
@@ -2020,10 +2010,6 @@ struct connman_device *connman_device_create_from_index(int index)
                ident = index2ident(index, NULL);
                break;
        case CONNMAN_DEVICE_TYPE_WIFI:
-#if defined TIZEN_EXT
-               ident = _get_wifi_ident();
-               if (!ident)
-#endif
                ident = index2ident(index, NULL);
                break;
        case CONNMAN_DEVICE_TYPE_BLUETOOTH: