All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Scott James Remnant <scott@netsplit.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/2] core: don't set BR/EDR support when no flags present
Date: Fri, 4 Apr 2014 10:25:28 +0300	[thread overview]
Message-ID: <20140404072528.GA16753@t440s.lan> (raw)
In-Reply-To: <1396564054-20566-1-git-send-email-scott@netsplit.com>

Hi Scott,

On Thu, Apr 03, 2014, Scott James Remnant wrote:
> The logic for setting the BR/EDR supported flag checked for the
> non-presence of the BR/EDR Unsupported flag without checking whether
> any flags were present at all.
> 
> This meant all LE-only devices that returned Scan Response Data were
> being marked as supporting BR/EDR, since the flag was only set in the
> initial AD and not the SRD.
> ---
>  src/adapter.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/adapter.c b/src/adapter.c
> index e396a3d..b8b9a9c 100644
> --- a/src/adapter.c
> +++ b/src/adapter.c
> @@ -4342,7 +4342,8 @@ static void update_found_devices(struct btd_adapter *adapter,
>  
>  	device_update_last_seen(dev, bdaddr_type);
>  
> -	if (bdaddr_type != BDADDR_BREDR && !(eir_data.flags & EIR_BREDR_UNSUP))
> +	if (bdaddr_type != BDADDR_BREDR && eir_data.flags &&
> +					!(eir_data.flags & EIR_BREDR_UNSUP))
>  		device_set_bredr_support(dev, true);
>  
>  	if (eir_data.name != NULL && eir_data.name_complete)

Both patches have been applied. Thanks.

One thing to note regarding this first one: this is actually not a
problem with current bluetooth-next since there we merge the adv_ind and
scan_rsp into a single mgmt device found event. I.e. with such a kernel
we will not need to have this extra non-zero flags check. I added an
extra code comment to this place so we don't forget to fix it.

Johan

  parent reply	other threads:[~2014-04-04  7:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-03 21:48 BUG: org.bluez.Device1.Connect() makes a BR/EDR connection to an LE-only Device on initial pairing Scott James Remnant
2014-04-03 22:27 ` [PATCH 1/2] core: don't set BR/EDR support when no flags present Scott James Remnant
2014-04-03 22:27   ` [PATCH 2/2] core: don't try BR/EDR for LE-only devices Scott James Remnant
2014-04-04  7:25   ` Johan Hedberg [this message]
2014-04-04 15:20     ` [PATCH 1/2] core: don't set BR/EDR support when no flags present Scott James Remnant
2014-04-04 15:57       ` Marcel Holtmann
2014-04-04 16:42         ` Scott James Remnant
2014-04-04 15:59       ` Johan Hedberg

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=20140404072528.GA16753@t440s.lan \
    --to=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=scott@netsplit.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.