summaryrefslogtreecommitdiff
path: root/libnm/nm-device-bt.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-07-30 10:57:45 -0400
committerDan Winship <danw@gnome.org>2014-09-04 09:20:10 -0400
commit3a54d050985d6ef2067b025571910a8ccd3cbd57 (patch)
tree1a226c3f91ec851fd7e55d519142ff1de24dc650 /libnm/nm-device-bt.c
parentf4957eb0b7b0c6c28121d728e8ab2da30bd49ac7 (diff)
downloadNetworkManager-3a54d050985d6ef2067b025571910a8ccd3cbd57.tar.gz
libnm-core: change all mac-address properties to G_TYPE_STRING
Make all mac-address properties (including NMSettingBluetooth:bdaddr, NMSettingOlpcMesh:dhcp-anycast-addr, and NMSettingWireless:bssid) be strings, using _nm_setting_class_transform_property() to handle translating to/from binary form when dealing with D-Bus. Update everything accordingly for the change, and also add a test for transformed setting properties to test-general.
Diffstat (limited to 'libnm/nm-device-bt.c')
-rw-r--r--libnm/nm-device-bt.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libnm/nm-device-bt.c b/libnm/nm-device-bt.c
index 40fc767097..925442e524 100644
--- a/libnm/nm-device-bt.c
+++ b/libnm/nm-device-bt.c
@@ -146,8 +146,7 @@ connection_compatible (NMDevice *device, NMConnection *connection, GError **erro
NMSettingConnection *s_con;
NMSettingBluetooth *s_bt;
const char *ctype;
- const GByteArray *mac;
- const char *hw_addr;
+ const char *hw_addr, *setting_addr;
NMBluetoothCapabilities dev_caps;
NMBluetoothCapabilities bt_type;
@@ -176,8 +175,8 @@ connection_compatible (NMDevice *device, NMConnection *connection, GError **erro
"Invalid device MAC address.");
return FALSE;
}
- mac = nm_setting_bluetooth_get_bdaddr (s_bt);
- if (mac && !nm_utils_hwaddr_matches (mac->data, mac->len, hw_addr, -1)) {
+ setting_addr = nm_setting_bluetooth_get_bdaddr (s_bt);
+ if (setting_addr && !nm_utils_hwaddr_matches (setting_addr, -1, hw_addr, -1)) {
g_set_error (error, NM_DEVICE_BT_ERROR, NM_DEVICE_BT_ERROR_MAC_MISMATCH,
"The MACs of the device and the connection didn't match.");
return FALSE;