x/net: incorrect parsing of rt_msghdr errno on Darwin #70593
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Go version
x/net v0.31.0
Output of
go env
in your module/workspace:What did you do?
I read the source and spotted an error.
What did you see happen?
I believe the parsing of route messages in https://go.googlesource.com/net/+/refs/tags/v0.31.0/route/route_classic.go is incorrect for Darwin (presumably other BSD variants). In particular it parses the errno from
28:32
in the header.However, the header (https://github.com/apple-oss-distributions/xnu/blob/33de042d024d46de5ff4e89f2471de6608e37fa4/bsd/net/route.h#L158) looks like:
errno
is immediately after thertm_seq
, which are sliced as20:24
, meaning it should be24:28
.What did you expect to see?
errno should be parsed from bytes
24:28
on DarwinThe text was updated successfully, but these errors were encountered: