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.
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.
(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.
Why can't we just return the full descriptor, if we don't understand the search query ?
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
Let me know if the submitted patch doesn't work for you.
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.
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
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
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
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