Bluetooth: hci_core: Fix hci_conn_hash_lookup_cis
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 8 Dec 2023 22:22:29 +0000 (17:22 -0500)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 15 Dec 2023 16:52:06 +0000 (11:52 -0500)
hci_conn_hash_lookup_cis shall always match the requested CIG and CIS
ids even when they are unset as otherwise it result in not being able
to bind/connect different sockets to the same address as that would
result in having multiple sockets mapping to the same hci_conn which
doesn't really work and prevents BAP audio configuration such as
AC 6(i) when CIG and CIS are left unset.

Fixes: c14516faede3 ("Bluetooth: hci_conn: Fix not matching by CIS ID")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
include/net/bluetooth/hci_core.h

index 20988623c5cc275a48e266916b64e75f26c54795..fb5e3ef3ec2ff1cacff11e7b525a9a899ba58023 100644 (file)
@@ -1227,11 +1227,11 @@ static inline struct hci_conn *hci_conn_hash_lookup_cis(struct hci_dev *hdev,
                        continue;
 
                /* Match CIG ID if set */
-               if (cig != BT_ISO_QOS_CIG_UNSET && cig != c->iso_qos.ucast.cig)
+               if (cig != c->iso_qos.ucast.cig)
                        continue;
 
                /* Match CIS ID if set */
-               if (id != BT_ISO_QOS_CIS_UNSET && id != c->iso_qos.ucast.cis)
+               if (id != c->iso_qos.ucast.cis)
                        continue;
 
                /* Match destination address if set */