linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Advertising report address types in mesh-io-generic
@ 2018-12-20 16:17 Michał Lowas-Rzechonek
  2018-12-20 17:00 ` Gix, Brian
  0 siblings, 1 reply; 5+ messages in thread
From: Michał Lowas-Rzechonek @ 2018-12-20 16:17 UTC (permalink / raw)
  To: linux-bluetooth

Hi,

I've noticed that mesh-io-generic.c filters advertising report events by
address type:

static void event_adv_report(struct mesh_io *io, const void *buf, uint8_t size)
{
    ...

	if (evt->addr_type != BDADDR_LE_PUBLIC &&
			evt->addr_type != BDADDR_LE_RANDOM)
		return;

Does anyone know why (Brian?)?

Bluetooth Mesh spec doesn't mention address types at all, so I assumed
that this layer shouldn't really care about MAC addresses and their
types.

-- 
Michał Lowas-Rzechonek <michal.lowas-rzechonek@silvair.com>
Silvair http://silvair.com
Jasnogórska 44, 31-358 Krakow, POLAND

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Advertising report address types in mesh-io-generic
  2018-12-20 16:17 Advertising report address types in mesh-io-generic Michał Lowas-Rzechonek
@ 2018-12-20 17:00 ` Gix, Brian
  2018-12-20 18:03   ` Michal Lowas-Rzechonek
  0 siblings, 1 reply; 5+ messages in thread
From: Gix, Brian @ 2018-12-20 17:00 UTC (permalink / raw)
  To: Michal Lowas-Rzechonek, linux-bluetooth

Hi Michal,

> -----Original Message-----
> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> owner@vger.kernel.org] On Behalf Of Michal Lowas-Rzechonek
> Sent: Thursday, December 20, 2018 8:17 AM
> To: linux-bluetooth@vger.kernel.org
> Subject: Advertising report address types in mesh-io-generic
> 
> Hi,
> 
> I've noticed that mesh-io-generic.c filters advertising report events by
> address type:
> 
> static void event_adv_report(struct mesh_io *io, const void *buf, uint8_t
> size) {
>     ...
> 
> 	if (evt->addr_type != BDADDR_LE_PUBLIC &&
> 			evt->addr_type != BDADDR_LE_RANDOM)
> 		return;

Address types can be BR/EDR (0x00), LE Public (0x01), and LE Random (0x02).

This filters out BR/EDR advertisements, which are not supported in Mesh. (should be LE Only).

> 
> Does anyone know why (Brian?)?
> 
> Bluetooth Mesh spec doesn't mention address types at all, so I assumed that
> this layer shouldn't really care about MAC addresses and their types.
> 
> --
> Michał Lowas-Rzechonek <michal.lowas-rzechonek@silvair.com>
> Silvair http://silvair.com
> Jasnogórska 44, 31-358 Krakow, POLAND

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Advertising report address types in mesh-io-generic
  2018-12-20 17:00 ` Gix, Brian
@ 2018-12-20 18:03   ` Michal Lowas-Rzechonek
  2018-12-20 18:09     ` Gix, Brian
  0 siblings, 1 reply; 5+ messages in thread
From: Michal Lowas-Rzechonek @ 2018-12-20 18:03 UTC (permalink / raw)
  To: linux-bluetooth

Brian,

Thanks for taking time to look into this.

On 12/20, Gix, Brian wrote:
> > 	if (evt->addr_type != BDADDR_LE_PUBLIC &&
> > 			evt->addr_type != BDADDR_LE_RANDOM)
> > 		return;
> 
> Address types can be BR/EDR (0x00), LE Public (0x01), and LE Random (0x02).
> 
> This filters out BR/EDR advertisements, which are not supported in Mesh. (should be LE Only).
Hmm. Correct me if I'm wrong, but the Bluetooth Core 5.0 spec,
Volume 2, part E, chapter 7.7.65.2 "LE Advertising Report Event", which
I believe we're dealing with, because of:

static bool dev_init(uint16_t index, struct mesh_io *io)
{
    ...
	bt_hci_register(tmp->hci, BT_HCI_EVT_LE_META_EVENT,
						event_callback, io, NULL);

and

static void event_callback(const void *buf, uint8_t size, void *user_data)
{
    ...
	switch (event) {
	case BT_HCI_EVT_LE_ADV_REPORT:
		event_adv_report(io, buf + 1, size - 1);
		break;

says that "address type" in that event is one of:

0x00 Public Device Address
0x01 Random Device Address
0x02 Public Identity Address (Corresponds to Resolved Private Address)
0x03 Random (static) Identity Address (Corresponds to Resolved Private
     Address)

and nowhere does it mention BR/EDR.

I don't think we're supposed to even receive BR/EDR addresses via HCI LE
Meta Event.

cheers
--
Michał Lowas-Rzechonek <michal.lowas-rzechonek@silvair.com>
Silvair http://silvair.com
Jasnogórska 44, 31-358 Krakow, POLAND

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Advertising report address types in mesh-io-generic
  2018-12-20 18:03   ` Michal Lowas-Rzechonek
@ 2018-12-20 18:09     ` Gix, Brian
  2018-12-20 18:19       ` Michal Lowas-Rzechonek
  0 siblings, 1 reply; 5+ messages in thread
From: Gix, Brian @ 2018-12-20 18:09 UTC (permalink / raw)
  To: Michal Lowas-Rzechonek, linux-bluetooth

Hi Michal,

> -----Original Message-----
> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> owner@vger.kernel.org] On Behalf Of Michal Lowas-Rzechonek
> Sent: Thursday, December 20, 2018 10:03 AM
> To: linux-bluetooth@vger.kernel.org
> Subject: Re: Advertising report address types in mesh-io-generic
> 
> Brian,
> 
> Thanks for taking time to look into this.
> 
> On 12/20, Gix, Brian wrote:
> > > 	if (evt->addr_type != BDADDR_LE_PUBLIC &&
> > > 			evt->addr_type != BDADDR_LE_RANDOM)
> > > 		return;
> >
> > Address types can be BR/EDR (0x00), LE Public (0x01), and LE Random
> (0x02).
> >
> > This filters out BR/EDR advertisements, which are not supported in Mesh.
> (should be LE Only).
> Hmm. Correct me if I'm wrong, but the Bluetooth Core 5.0 spec, Volume 2,
> part E, chapter 7.7.65.2 "LE Advertising Report Event", which I believe we're
> dealing with, because of:
> 
> static bool dev_init(uint16_t index, struct mesh_io *io) {
>     ...
> 	bt_hci_register(tmp->hci, BT_HCI_EVT_LE_META_EVENT,
> 						event_callback, io, NULL);
> 
> and
> 
> static void event_callback(const void *buf, uint8_t size, void *user_data) {
>     ...
> 	switch (event) {
> 	case BT_HCI_EVT_LE_ADV_REPORT:
> 		event_adv_report(io, buf + 1, size - 1);
> 		break;
> 
> says that "address type" in that event is one of:
> 
> 0x00 Public Device Address
> 0x01 Random Device Address
> 0x02 Public Identity Address (Corresponds to Resolved Private Address)
> 0x03 Random (static) Identity Address (Corresponds to Resolved Private
>      Address)
> 
> and nowhere does it mention BR/EDR.
> 
> I don't think we're supposed to even receive BR/EDR addresses via HCI LE
> Meta Event.

I think you are probably correct.  This may be a remnant that we picked up from code that was
intended to serve both BR/EDR and LE advertisements.  I will remove that check first thing after 
the existing patchset is applied.


> 
> cheers
> --
> Michał Lowas-Rzechonek <michal.lowas-rzechonek@silvair.com>
> Silvair http://silvair.com
> Jasnogórska 44, 31-358 Krakow, POLAND

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Advertising report address types in mesh-io-generic
  2018-12-20 18:09     ` Gix, Brian
@ 2018-12-20 18:19       ` Michal Lowas-Rzechonek
  0 siblings, 0 replies; 5+ messages in thread
From: Michal Lowas-Rzechonek @ 2018-12-20 18:19 UTC (permalink / raw)
  To: linux-bluetooth

On 12/20, Gix, Brian wrote:
> > says that "address type" in that event is one of:
> > 
> > 0x00 Public Device Address
> > 0x01 Random Device Address
> > 0x02 Public Identity Address (Corresponds to Resolved Private Address)
> > 0x03 Random (static) Identity Address (Corresponds to Resolved Private
> >      Address)
> > 
> > and nowhere does it mention BR/EDR.
> > 
> > I don't think we're supposed to even receive BR/EDR addresses via HCI LE
> > Meta Event.
> 
> I think you are probably correct.  This may be a remnant that we picked up from code that was
> intended to serve both BR/EDR and LE advertisements.  I will remove that check first thing after 
> the existing patchset is applied.
Thanks! \o/

Thanks for the work by the way, we're still digging into the codebase
and getting our heads around it, but I'll make sure to give you folks a
hand when we finally manage to add something substantial.

cheers
-- 
Michał Lowas-Rzechonek <michal.lowas-rzechonek@silvair.com>
Silvair http://silvair.com
Jasnogórska 44, 31-358 Krakow, POLAND

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-12-20 18:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-20 16:17 Advertising report address types in mesh-io-generic Michał Lowas-Rzechonek
2018-12-20 17:00 ` Gix, Brian
2018-12-20 18:03   ` Michal Lowas-Rzechonek
2018-12-20 18:09     ` Gix, Brian
2018-12-20 18:19       ` Michal Lowas-Rzechonek

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).