summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Kim <jeik01.kim@samsung.com>2021-07-05 22:46:19 +0900
committerJaehyun Kim <jeik01.kim@samsung.com>2021-07-05 22:47:16 +0900
commitfac1c8b4bd3f6853d8548ad40902fdf25b345f94 (patch)
treea680f585bdba93181d54ff45f4913a16f3d3198b
parentfd0692ba60b03da85aa02aa5eb642600013f7c7b (diff)
downloadconnman-fac1c8b4bd3f6853d8548ad40902fdf25b345f94.tar.gz
connman-fac1c8b4bd3f6853d8548ad40902fdf25b345f94.tar.bz2
connman-fac1c8b4bd3f6853d8548ad40902fdf25b345f94.zip
Use the last updated MAC address before turning on wifisubmit/tizen/20210706.115004accepted/tizen/unified/20210708.131505
MAC randomization does not work properly when there are multiple wifi interfaces or in some devices that do not create a .mac.info file. So, to solve this problem, a permanent MAC address that is set before wifi up is used. If a permanent MAC address is in built-in physical device, it's hardly get it at an initial creation. So, if there is a MAC address updated from netlink before wifi is on, it is used. * MAC randomization works only when wifi is turned on. Change-Id: Ia7a9ad0affaa6deca974199100a56e7378b6c195 Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
-rw-r--r--packaging/connman.spec2
-rwxr-xr-xsrc/device.c18
-rw-r--r--src/inet.c11
3 files changed, 5 insertions, 26 deletions
diff --git a/packaging/connman.spec b/packaging/connman.spec
index db8a8481..6af8ff90 100644
--- a/packaging/connman.spec
+++ b/packaging/connman.spec
@@ -6,7 +6,7 @@
Name: connman
Version: 1.38
-Release: 8
+Release: 9
License: GPL-2.0+
Summary: Connection Manager
Url: http://connman.net
diff --git a/src/device.c b/src/device.c
index 89258bac..d0825ce2 100755
--- a/src/device.c
+++ b/src/device.c
@@ -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:
diff --git a/src/inet.c b/src/inet.c
index 48145461..e0ef7dbb 100644
--- a/src/inet.c
+++ b/src/inet.c
@@ -451,15 +451,8 @@ void connman_inet_update_device_ident(struct connman_device *device)
case CONNMAN_DEVICE_TYPE_ETHERNET:
case CONNMAN_DEVICE_TYPE_GADGET:
case CONNMAN_DEVICE_TYPE_WIFI:
- if (type == CONNMAN_DEVICE_TYPE_WIFI)
- addr = _get_wifi_addr();
- if (!addr)
- addr = index2addr(index);
-
- if (type == CONNMAN_DEVICE_TYPE_WIFI)
- ident = _get_wifi_ident();
- if (!ident)
- ident = index2ident(index, NULL);
+ addr = index2addr(index);
+ ident = index2ident(index, NULL);
break;
case CONNMAN_DEVICE_TYPE_CELLULAR:
ident = index2ident(index, NULL);