diff options
author | Thomas Haller <thaller@redhat.com> | 2016-10-12 19:50:32 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-10-24 10:14:02 +0200 |
commit | 95ab69b761293993c27d64137b9c5163d4773de0 (patch) | |
tree | e0f9f1c06c212d66d534bcfd47b53863557f94c9 /libnm/nm-device-wifi.c | |
parent | 21d7aa92044b458028e1968cd09ec015edf977ec (diff) | |
download | NetworkManager-95ab69b761293993c27d64137b9c5163d4773de0.tar.gz |
libnm: coerce empty strings to NULL for D-Bus properties
On D-Bus level, string (s) or object paths (o) cannot be NULL.
Thus, whenver server exposes such an object, it gets automatically
coerced to "" or "/", respectively.
On client side, libnm should coerce certain properties back, for which
"" is just not a sensible value.
For example, an empty NM_DEVICE_ETHERNET_HW_ADDRESS should be instead
exposed as NULL.
Technically, this is an API change. However, all users were well advised
to expect both NULL and "" as possible return values and handle them
accordingly.
Diffstat (limited to 'libnm/nm-device-wifi.c')
-rw-r--r-- | libnm/nm-device-wifi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libnm/nm-device-wifi.c b/libnm/nm-device-wifi.c index f0b53f54f1..f705dbd2ea 100644 --- a/libnm/nm-device-wifi.c +++ b/libnm/nm-device-wifi.c @@ -100,7 +100,7 @@ nm_device_wifi_get_hw_address (NMDeviceWifi *device) { g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL); - return NM_DEVICE_WIFI_GET_PRIVATE (device)->hw_address; + return nm_str_not_empty (NM_DEVICE_WIFI_GET_PRIVATE (device)->hw_address); } /** @@ -117,7 +117,7 @@ nm_device_wifi_get_permanent_hw_address (NMDeviceWifi *device) { g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL); - return NM_DEVICE_WIFI_GET_PRIVATE (device)->perm_hw_address; + return nm_str_not_empty (NM_DEVICE_WIFI_GET_PRIVATE (device)->perm_hw_address); } /** |