diff mbox series

[1/1] Bluetooth: ISO: Allow binding a bcast listener to 0 bises

Message ID 20230927075835.20125-2-iulia.tanasescu@nxp.com
State Accepted
Commit 8e437e71f361195157ec4149eaf06679a85bf188
Headers show
Series Bluetooth: ISO: Allow binding a bcast listener to 0 bises | expand

Commit Message

Iulia Tanasescu Sept. 27, 2023, 7:58 a.m. UTC
This makes it possible to bind a broadcast listener to a broadcaster
address without asking for any BIS indexes to sync with.

Signed-off-by: Iulia Tanasescu <iulia.tanasescu@nxp.com>
---
 net/bluetooth/hci_conn.c | 2 +-
 net/bluetooth/iso.c      | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

Comments

bluez.test.bot@gmail.com Sept. 27, 2023, 8:44 a.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=787934

---Test result---

Test Summary:
CheckPatch                    PASS      0.95 seconds
GitLint                       PASS      0.33 seconds
SubjectPrefix                 PASS      0.10 seconds
BuildKernel                   PASS      40.16 seconds
CheckAllWarning               PASS      44.43 seconds
CheckSparse                   PASS      50.99 seconds
CheckSmatch                   PASS      136.07 seconds
BuildKernel32                 PASS      38.81 seconds
TestRunnerSetup               PASS      600.28 seconds
TestRunner_l2cap-tester       PASS      36.44 seconds
TestRunner_iso-tester         PASS      60.29 seconds
TestRunner_bnep-tester        PASS      12.51 seconds
TestRunner_mgmt-tester        PASS      255.74 seconds
TestRunner_rfcomm-tester      PASS      19.34 seconds
TestRunner_sco-tester         PASS      22.27 seconds
TestRunner_ioctl-tester       PASS      21.76 seconds
TestRunner_mesh-tester        PASS      16.73 seconds
TestRunner_smp-tester         PASS      17.08 seconds
TestRunner_userchan-tester    PASS      15.17 seconds
IncrementalBuild              PASS      38.15 seconds



---
Regards,
Linux Bluetooth
Luiz Augusto von Dentz Sept. 27, 2023, 9:48 p.m. UTC | #2
Hi Iulia,

On Wed, Sep 27, 2023 at 12:59 AM Iulia Tanasescu
<iulia.tanasescu@nxp.com> wrote:
>
> This makes it possible to bind a broadcast listener to a broadcaster
> address without asking for any BIS indexes to sync with.

Is the intend to use this logic for discovering broadcaster? I guess
we should make it clearer and perhaps have iso-tester also testing its
behavior.

> Signed-off-by: Iulia Tanasescu <iulia.tanasescu@nxp.com>
> ---
>  net/bluetooth/hci_conn.c | 2 +-
>  net/bluetooth/iso.c      | 3 +--
>  2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
> index e62a5f368a51..c4395d34da70 100644
> --- a/net/bluetooth/hci_conn.c
> +++ b/net/bluetooth/hci_conn.c
> @@ -2138,7 +2138,7 @@ int hci_le_big_create_sync(struct hci_dev *hdev, struct hci_conn *hcon,
>         } pdu;
>         int err;
>
> -       if (num_bis > sizeof(pdu.bis))
> +       if (num_bis < 0x01 || num_bis > sizeof(pdu.bis))
>                 return -EINVAL;
>
>         err = qos_set_big(hdev, qos);
> diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
> index 2132a16be93c..8ab7ea5ebedf 100644
> --- a/net/bluetooth/iso.c
> +++ b/net/bluetooth/iso.c
> @@ -790,8 +790,7 @@ static int iso_sock_bind_bc(struct socket *sock, struct sockaddr *addr,
>         BT_DBG("sk %p bc_sid %u bc_num_bis %u", sk, sa->iso_bc->bc_sid,
>                sa->iso_bc->bc_num_bis);
>
> -       if (addr_len > sizeof(*sa) + sizeof(*sa->iso_bc) ||
> -           sa->iso_bc->bc_num_bis < 0x01 || sa->iso_bc->bc_num_bis > 0x1f)
> +       if (addr_len > sizeof(*sa) + sizeof(*sa->iso_bc))
>                 return -EINVAL;
>
>         bacpy(&iso_pi(sk)->dst, &sa->iso_bc->bc_bdaddr);
> --
> 2.39.2
>
diff mbox series

Patch

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index e62a5f368a51..c4395d34da70 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -2138,7 +2138,7 @@  int hci_le_big_create_sync(struct hci_dev *hdev, struct hci_conn *hcon,
 	} pdu;
 	int err;
 
-	if (num_bis > sizeof(pdu.bis))
+	if (num_bis < 0x01 || num_bis > sizeof(pdu.bis))
 		return -EINVAL;
 
 	err = qos_set_big(hdev, qos);
diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
index 2132a16be93c..8ab7ea5ebedf 100644
--- a/net/bluetooth/iso.c
+++ b/net/bluetooth/iso.c
@@ -790,8 +790,7 @@  static int iso_sock_bind_bc(struct socket *sock, struct sockaddr *addr,
 	BT_DBG("sk %p bc_sid %u bc_num_bis %u", sk, sa->iso_bc->bc_sid,
 	       sa->iso_bc->bc_num_bis);
 
-	if (addr_len > sizeof(*sa) + sizeof(*sa->iso_bc) ||
-	    sa->iso_bc->bc_num_bis < 0x01 || sa->iso_bc->bc_num_bis > 0x1f)
+	if (addr_len > sizeof(*sa) + sizeof(*sa->iso_bc))
 		return -EINVAL;
 
 	bacpy(&iso_pi(sk)->dst, &sa->iso_bc->bc_bdaddr);