diff options
| author | Michael Biebl <biebl@debian.org> | 2017-11-07 00:14:39 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2017-11-07 00:14:39 +0100 |
| commit | 90e8691111889a7b5f3c812f5a41f15a8a058913 (patch) | |
| tree | f101a879eca27c34a9bfa5f3da52266b22539a36 /libnm/nm-device-bt.c | |
| parent | bdb6eeb0670658255c2a4c3c501c0a27fa8cfe55 (diff) | |
New upstream version 1.9.90 upstream/1.9.90
Diffstat (limited to 'libnm/nm-device-bt.c')
| -rw-r--r-- | libnm/nm-device-bt.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libnm/nm-device-bt.c b/libnm/nm-device-bt.c index 0fcd28b9..a47e3958 100644 --- a/libnm/nm-device-bt.c +++ b/libnm/nm-device-bt.c @@ -131,12 +131,19 @@ connection_compatible (NMDevice *device, NMConnection *connection, GError **erro if (!NM_DEVICE_CLASS (nm_device_bt_parent_class)->connection_compatible (device, connection, error)) return FALSE; - if (!nm_connection_is_type (connection, NM_SETTING_BLUETOOTH_SETTING_NAME)) { + if ( !nm_connection_is_type (connection, NM_SETTING_BLUETOOTH_SETTING_NAME) + || !(s_bt = nm_connection_get_setting_bluetooth (connection))) { g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION, _("The connection was not a Bluetooth connection.")); return FALSE; } + if (nm_streq0 (nm_setting_bluetooth_get_connection_type (s_bt), NM_SETTING_BLUETOOTH_TYPE_NAP)) { + g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION, + _("The connection is of Bluetooth NAP type.")); + return FALSE; + } + /* Check BT address */ hw_addr = nm_device_bt_get_hw_address (NM_DEVICE_BT (device)); if (hw_addr) { @@ -145,7 +152,6 @@ connection_compatible (NMDevice *device, NMConnection *connection, GError **erro _("Invalid device Bluetooth address.")); return FALSE; } - s_bt = nm_connection_get_setting_bluetooth (connection); 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_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION, |