summaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-06-28 21:15:53 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-08-11 20:43:02 +0200
commit9f78191cc9f1b34c2e2afd7b554a83bf034092dd (patch)
treef00351059ed7f3f6aa45ea80163ed9b885ed2a26 /include/net/bluetooth
parentBluetooth: hci_sync: Fix not handling ISO_LINK in hci_abort_conn_sync (diff)
downloadlinux-9f78191cc9f1b34c2e2afd7b554a83bf034092dd.tar.xz
linux-9f78191cc9f1b34c2e2afd7b554a83bf034092dd.zip
Bluetooth: hci_conn: Always allocate unique handles
This attempts to always allocate a unique handle for connections so they can be properly aborted by the likes of hci_abort_conn, so this uses the invalid range as a pool of unset handles that way if userspace is trying to create multiple connections at once each will be given a unique handle which will be considered unset. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'include/net/bluetooth')
-rw-r--r--include/net/bluetooth/hci_core.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 2dd59e3a51b3..491ab83ccafc 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -321,8 +321,8 @@ struct adv_monitor {
#define HCI_MAX_SHORT_NAME_LENGTH 10
-#define HCI_CONN_HANDLE_UNSET 0xffff
#define HCI_CONN_HANDLE_MAX 0x0eff
+#define HCI_CONN_HANDLE_UNSET(_handle) (_handle > HCI_CONN_HANDLE_MAX)
/* Min encryption key size to match with SMP */
#define HCI_MIN_ENC_KEY_SIZE 7