You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AF_BLUETOOTH socket type lacks support for specifying CID and address type in sockaddr_l2. These structure members have been present since 2009 and 2012 respectively:
changed the title [-]sockaddr_l2 lacks CID, address type (AF_BLUETOOTH sockets)[/-][+]sockaddr_hci lacks hci_channel (AF_BLUETOOTH sockets)[/+]on Feb 27, 2025
Activity
mikeryan commentedon Dec 26, 2015
The AF_BLUETOOTH socket type lacks support for specifying CID and address type in sockaddr_l2. These structure members have been present since 2009 and 2012 respectively:
https://git.kernel.org/cgit/bluetooth/bluez.git/commit/?id=3de95535
https://git.kernel.org/cgit/bluetooth/bluez.git/commit/?id=ba801fcd
The current version of the full structure can be found here:
https://git.kernel.org/cgit/bluetooth/bluez.git/tree/lib/l2cap.h?id=1b9e48f4#n40
The Python code in question can be found here:
https://github.com/python/cpython/blob/4f9794dbcaa6ee7ddc6ab175a57e7f01ebe64353/Modules/socketmodule.c#L1108
mikeryan commentedon Dec 28, 2015
AF_BLUETOOTH also lacks support for hci_channel in sockaddr_hci for BTPROTO_HCI sockets:
https://git.kernel.org/cgit/bluetooth/bluez.git/tree/lib/hci.h?h=5.37#n2340
This feature has been present in BlueZ since 2010:
https://git.kernel.org/cgit/bluetooth/bluez.git/commit/?id=12d02e7f
(Note that the latest BlueZ release includes a total of five different channels that should be supported)
encukou commentedon Feb 27, 2025
CID and address type were added in #129288.
[-]sockaddr_l2 lacks CID, address type (AF_BLUETOOTH sockets)[/-][+]sockaddr_hci lacks hci_channel (AF_BLUETOOTH sockets)[/+]serhiy-storchaka commentedon Apr 1, 2025
TODO: add support for hci_channel in sockaddr_hci for BTPROTO_HCI sockets.
The code will be complicated, because currently only a single bytes/int value is accepted as an address, not a tuple. See also #69232.
serhiy-storchaka commentedon Apr 4, 2025
Note that there were bugs in support of BTPROTO_HCI sockets.
pythongh-70145: Add support for channels in Bluetooth HCI protocol
gh-70145: Add support for channels in Bluetooth HCI protocol (GH-132481)