If device is already paired there is no need to fail with handover if adapter is not pairable. --- plugins/neard.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/plugins/neard.c b/plugins/neard.c index 668c46f..131e8bd 100644 --- a/plugins/neard.c +++ b/plugins/neard.c @@ -579,9 +579,6 @@ static int check_adapter(struct btd_adapter *adapter) if (btd_adapter_check_oob_handler(adapter)) return -EINPROGRESS; - if (!btd_adapter_get_pairable(adapter)) - return -ENONET; - if (!btd_adapter_ssp_enabled(adapter)) return -ENOTSUP; @@ -664,6 +661,12 @@ static DBusMessage *push_oob(DBusConnection *conn, DBusMessage *msg, void *data) return error_reply(msg, -err); } + if (!btd_adapter_get_pairable(adapter)) { + free_oob_params(&remote); + + return error_reply(msg, ENONET); + } + store_params(adapter, device, &remote); free_oob_params(&remote); @@ -722,6 +725,12 @@ static DBusMessage *request_oob(DBusConnection *conn, DBusMessage *msg, return error_reply(msg, -err); } + if (!btd_adapter_get_pairable(adapter)) { + free_oob_params(&remote); + + return error_reply(msg, ENONET); + } + store_params(adapter, device, &remote); if (!remote.hash) { -- 1.8.1.1 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html