[3.12] gh-111178: Fix getsockaddrarg() undefined behavior (GH-131668) (GH-131977) (#131979)
[3.13] gh-111178: Fix getsockaddrarg() undefined behavior (GH-131668) (GH-131977)
gh-111178: Fix getsockaddrarg() undefined behavior (GH-131668)
Don't pass direct references to sockaddr members since their type may
not match PyArg_ParseTuple() types. Instead, use temporary 'int' and
'unsigned char' variables, and update sockaddr members afterwards.
On FreeBSD, treat BTPROTO_HCI node name as a bytes string,
not as an integer.
(cherry picked from commit
c318a03b17c3e58e9c46beb84ab7070b7baa303b)
Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit
8cd29c2b533e5a1a262238695d05f2a7c44d6455)
Co-authored-by: Victor Stinner <vstinner@python.org>