Bug 245899 - [Patch] Fix service UUIDs in advertising data/scan response
Summary: [Patch] Fix service UUIDs in advertising data/scan response
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: wireless (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Hans Petter Selasky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-25 09:24 UTC by Marc Veldman
Modified: 2020-05-18 09:18 UTC (History)
2 users (show)

See Also:


Attachments
Properly update ad field length (689 bytes, patch)
2020-04-25 09:24 UTC, Marc Veldman
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Veldman 2020-04-25 09:24:42 UTC
Created attachment 213773 [details]
Properly update ad field length

The length octet of the 'partial service id list' AD type was not set properly.
Set the lenght position pointer to the current buffer position,
increment after each 16-bit uuid is added.

Bluetooth Core specification 5.2 Vol3, Part C, section 11.

Example:

https://www.silabs.com/community/wireless/bluetooth/knowledge-base.entry.html/2017/02/10/bluetooth_advertisin-hGsf

Replace deprecated atoi with strdol while here.
Comment 1 commit-hook freebsd_committer 2020-04-26 08:31:49 UTC
A commit references this bug:

Author: hselasky
Date: Sun Apr 26 08:31:08 UTC 2020
New revision: 360329
URL: https://svnweb.freebsd.org/changeset/base/360329

Log:
  Properly update AD field length in hccontrol(8).

  While at it use strtol() instead of atoi() to support hexadecimal
  numbers aswell as 10-base numbers.

  Submitted by:	Marc Veldman <marc@bumblingdork.com>
  PR:		245899
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Changes:
  head/usr.sbin/bluetooth/hccontrol/le.c
Comment 2 commit-hook freebsd_committer 2020-05-18 09:18:02 UTC
A commit references this bug:

Author: hselasky
Date: Mon May 18 09:17:05 UTC 2020
New revision: 361188
URL: https://svnweb.freebsd.org/changeset/base/361188

Log:
  MFC r360329:
  Properly update AD field length in hccontrol(8).

  While at it use strtol() instead of atoi() to support hexadecimal
  numbers aswell as 10-base numbers.

  Submitted by:	Marc Veldman <marc@bumblingdork.com>
  PR:		245899
  Sponsored by:	Mellanox Technologies

Changes:
_U  stable/12/
  stable/12/usr.sbin/bluetooth/hccontrol/le.c
Comment 3 commit-hook freebsd_committer 2020-05-18 09:18:04 UTC
A commit references this bug:

Author: hselasky
Date: Mon May 18 09:17:38 UTC 2020
New revision: 361189
URL: https://svnweb.freebsd.org/changeset/base/361189

Log:
  MFC r360329:
  Properly update AD field length in hccontrol(8).

  While at it use strtol() instead of atoi() to support hexadecimal
  numbers aswell as 10-base numbers.

  Submitted by:	Marc Veldman <marc@bumblingdork.com>
  PR:		245899
  Sponsored by:	Mellanox Technologies

Changes:
_U  stable/11/
  stable/11/usr.sbin/bluetooth/hccontrol/le.c