x/sys/unix: SockaddrL2 byte order mismatch #39045
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
It reproduces on the latest version of x/sys.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
There are some underlying issues with the "input" plugin for Bluez and binding to Bluetooth sockets. They can be mitigated by restarting the bluetooth daemon and racing to bind the socket.
What did you expect to see?
What did you see instead?
Change proposals
Remove the three lines reversing the order of the bytes, which would mean that
SockaddrL2.Addr
will be expected to be in network order, not the order that it would usually appear as a string.Alternatively, we could add the same three lines to
anyToSockaddr
here, so that the order is the same as what is expected as input toBind
andConnect
.The first option seems like the better option to me since it is in line with
RawSockaddrL2
and the underlying syscall API. But the second one may be "more friendly" as the byte order matches the string's ordering.The text was updated successfully, but these errors were encountered: