Repository navigation
sockaddr_hci lacks hci_channel (AF_BLUETOOTH sockets) #70145
Description
Activity
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=ba801fcdThe 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:
- addedextension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Dec 26, 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)
- addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on Jan 14, 2016 CID and address type were added in #129288.
- changed the title
[-]sockaddr_l2 lacks CID, address type (AF_BLUETOOTH sockets)[/-][+]sockaddr_hci lacks hci_channel (AF_BLUETOOTH sockets)[/+]on Feb 27, 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.
Note that there were bugs in support of BTPROTO_HCI sockets.
- Incorrect support on FreeBSD (which should be close to NetBSD than to Linux). Presumably fixed by PR gh-111178: Fix getsockaddrarg() undefined behavior #131668.
- hci_channel was not initialized. That made the feature unusable on Fedora based distributives. See Possible use of unitialized socked address #132075.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs