Re: [PATCH BlueZ 1/2] att: Return error in case Exchange MTU is used over BR/EDR link

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Wed, Jul 3, 2019 at 6:42 PM Luiz Augusto von Dentz
<luiz.dentz@xxxxxxxxx> wrote:
>
> From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
>
> In case of BR/EDR the L2CAP MTU negotion is used instead:
>
>   BLUETOOTH CORE SPECIFICATION Version 5.1 | Vol 3, Part G page 2370
>   4.3.1 Exchange MTU
>
>   This sub-procedure shall not be used on a BR/EDR physical link since
>   the MTU size is negotiated using L2CAP channel configuration
>   procedures.
> ---
>  src/shared/att.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>
> diff --git a/src/shared/att.c b/src/shared/att.c
> index 04577eddd..0ea6d55bd 100644
> --- a/src/shared/att.c
> +++ b/src/shared/att.c
> @@ -836,6 +836,22 @@ static void handle_notify(struct bt_att *att, uint8_t opcode, uint8_t *pdu,
>                 if (!opcode_match(notify->opcode, opcode))
>                         continue;
>
> +               /* BLUETOOTH CORE SPECIFICATION Version 5.1 | Vol 3, Part G
> +                * page 2370
> +                *
> +                * 4.3.1 Exchange MTU
> +                *
> +                * This sub-procedure shall not be used on a BR/EDR physical
> +                * link since the MTU size is negotiated using L2CAP channel
> +                * configuration procedures.
> +                */
> +               if (bt_att_get_link_type(att) == BT_ATT_LINK_BREDR) {
> +                       switch (opcode) {
> +                       case BT_ATT_OP_MTU_REQ:
> +                               goto not_supported;
> +                       }
> +               }
> +
>                 found = true;
>
>                 if (notify->callback)
> @@ -847,6 +863,7 @@ static void handle_notify(struct bt_att *att, uint8_t opcode, uint8_t *pdu,
>                         break;
>         }
>
> +not_supported:
>         /*
>          * If this was not a command and no handler was registered for it,
>          * respond with "Not Supported"
> --
> 2.21.0

Applied.


-- 
Luiz Augusto von Dentz



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux