linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH BlueZ 1/2] att: Return error in case Exchange MTU is used over BR/EDR link
Date: Tue, 9 Jul 2019 11:14:45 +0300	[thread overview]
Message-ID: <CABBYNZJCSeXJoU6QqwDKgvWYOs+K+7A5oFxO4BT4sr-N3FmEyA@mail.gmail.com> (raw)
In-Reply-To: <20190703154219.6988-1-luiz.dentz@gmail.com>

Hi,

On Wed, Jul 3, 2019 at 6:42 PM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> 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

      parent reply	other threads:[~2019-07-09  8:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03 15:42 [PATCH BlueZ 1/2] att: Return error in case Exchange MTU is used over BR/EDR link Luiz Augusto von Dentz
2019-07-03 15:42 ` [PATCH BlueZ 2/2] gatt: Require medium security for ATT socket over BR/EDR Luiz Augusto von Dentz
2019-07-09  8:14 ` Luiz Augusto von Dentz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABBYNZJCSeXJoU6QqwDKgvWYOs+K+7A5oFxO4BT4sr-N3FmEyA@mail.gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).