x/net/route: ParseRIB fails with errMessageTooShort on an AF_ROUTE message from Darwin #44740
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
OS-Darwin
Milestone
I have a macOS program which listens to route changes from the kernel.
It opens an AF_ROUTE socket:
Then reads messages in a loop:
It works in general, until it hit this 50 byte message from the kernel:
Adding some logging and a panic where it was returning the error:
Notably, that LinkAddr (
0x91, 0xe0, 0xf0, 0x1, 0x0, 0x0
) in the final 6 bytes of the 50 byte message.But
parseAddrs
is expecting some padding at the end? TheerrMessageTooShort
case it's hitting:Maybe this package was designed purely for getting the RIBs via sysctl (with https://pkg.go.dev/golang.org/x/net/route#FetchRIB) where they differ from the format sent over AF_ROUTE sockets? Maybe?
/cc @ianlancetaylor @mikioh @tklauser @danderson @DentonGentry
The text was updated successfully, but these errors were encountered: