Bug 210089 - sdpd: Service can not be discovered from Windows® 10 Home
Summary: sdpd: Service can not be discovered from Windows® 10 Home
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.3-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: Hans Petter Selasky
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-06-07 07:54 UTC by Tatsuki Makino
Modified: 2019-02-15 09:26 UTC (History)
2 users (show)

See Also:


Attachments
experimental patch for sdpd (3.96 KB, patch)
2016-06-07 07:54 UTC, Tatsuki Makino
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tatsuki Makino 2016-06-07 07:54:49 UTC
Created attachment 171124 [details]
experimental patch for sdpd

Microsoft®'s bluetooth stack sends a same packet as command "sdpcontrol -a bdaddr search 0x0100" when searching services.
If the patch which attached applies to sdpd, sdpd will return a result for searching 0x0100.
But, the patch cannot solve all problems of this.

Microsoft and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.
Comment 1 Richard Kralovic 2019-02-02 22:31:15 UTC
This affects other systems as well, e.g., Android also uses search for 0x0100 and thus cannot connect to services managed by sdpd.

Sdpd matches only profile uuids, however, bluetooth core specification (https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=457080), Section 2.5.2 says that that any service record that has any attribute whose value contains the requested uuid must match.

It seems to me that the proposed patch goes in the right direction, but it should check all attributes instead of the selected ones only.
Comment 2 Tatsuki Makino 2019-02-08 06:23:22 UTC
(In reply to Richard Kralovic from comment #1)
Thank you for introducing the specification book.
But it will take 10 years or more for me to read and understand it :)

attachment 171124 [details] doesn't solve this problem. The purpose of it is to deceive the Windows.
When "sdpcontrol -a patched-FreeBSD search 0x0100" is executed, the result of services that the patched-FreeBSD can serve increases. I think that the result of hcidump analyzed with wireshark is also sufficient. But, nothing appears in service list of Windows 10 1809.
I don't know why.
Comment 3 Hans Petter Selasky freebsd_committer 2019-02-08 10:40:10 UTC
Why can't we just return the full descriptor, if we don't understand the search query ?
Comment 4 commit-hook freebsd_committer 2019-02-08 13:10:52 UTC
A commit references this bug:

Author: hselasky
Date: Fri Feb  8 13:10:46 UTC 2019
New revision: 343905
URL: https://svnweb.freebsd.org/changeset/base/343905

Log:
  Improve Bluetooth device discovery support for Android and Microsoft devices.

  Tested using the virtual_bt_speaker(8) tool from the virtual_oss(8)
  project at github.com.

  PR:			210089
  MFC after:		1 week
  Sponsored by:		Mellanox Technologies

Changes:
  head/usr.sbin/bluetooth/sdpd/ssar.c
Comment 5 Hans Petter Selasky freebsd_committer 2019-02-08 13:11:27 UTC
Let me know if the submitted patch doesn't work for you.
Comment 6 Tatsuki Makino 2019-02-10 08:55:15 UTC
I transplanted comment #4 to 10.4-STABLE r343910.
It works fine.

It is difficult to explain in English...
If "btpand -d freebsd -i tap0 -s PANU" is run, It is not appeared in the list of services in the properties dialog of icon on "devices and printers". But PAN can be connect.
If "rfcomm_sppd -S -a freebsd -t" is run, It appear in the list of services in the properties dialog of icon on "devices and printers".

Thank you for fixing.
Comment 7 commit-hook freebsd_committer 2019-02-15 09:20:31 UTC
A commit references this bug:

Author: hselasky
Date: Fri Feb 15 09:20:10 UTC 2019
New revision: 344144
URL: https://svnweb.freebsd.org/changeset/base/344144

Log:
  MFC r343905:
  Improve Bluetooth device discovery support for Android and Microsoft devices.

  Tested using the virtual_bt_speaker(8) tool from the virtual_oss(8)
  project at github.com.

  PR:			210089
  Sponsored by:		Mellanox Technologies

Changes:
_U  stable/12/
  stable/12/usr.sbin/bluetooth/sdpd/ssar.c
Comment 8 commit-hook freebsd_committer 2019-02-15 09:21:34 UTC
A commit references this bug:

Author: hselasky
Date: Fri Feb 15 09:21:17 UTC 2019
New revision: 344145
URL: https://svnweb.freebsd.org/changeset/base/344145

Log:
  MFC r343905:
  Improve Bluetooth device discovery support for Android and Microsoft devices.

  Tested using the virtual_bt_speaker(8) tool from the virtual_oss(8)
  project at github.com.

  PR:			210089
  Sponsored by:		Mellanox Technologies

Changes:
_U  stable/11/
  stable/11/usr.sbin/bluetooth/sdpd/ssar.c
Comment 9 commit-hook freebsd_committer 2019-02-15 09:22:37 UTC
A commit references this bug:

Author: hselasky
Date: Fri Feb 15 09:22:24 UTC 2019
New revision: 344146
URL: https://svnweb.freebsd.org/changeset/base/344146

Log:
  MFC r343905:
  Improve Bluetooth device discovery support for Android and Microsoft devices.

  Tested using the virtual_bt_speaker(8) tool from the virtual_oss(8)
  project at github.com.

  PR:			210089
  Sponsored by:		Mellanox Technologies

Changes:
_U  stable/10/
  stable/10/usr.sbin/bluetooth/sdpd/ssar.c
Comment 10 commit-hook freebsd_committer 2019-02-15 09:26:43 UTC
A commit references this bug:

Author: hselasky
Date: Fri Feb 15 09:25:52 UTC 2019
New revision: 344147
URL: https://svnweb.freebsd.org/changeset/base/344147

Log:
  MFC r343905:
  Improve Bluetooth device discovery support for Android and Microsoft devices.

  Tested using the virtual_bt_speaker(8) tool from the virtual_oss(8)
  project at github.com.

  PR:			210089
  Sponsored by:		Mellanox Technologies

Changes:
_U  stable/9/usr.sbin/
_U  stable/9/usr.sbin/bluetooth/sdpd/
  stable/9/usr.sbin/bluetooth/sdpd/ssar.c