route.ParseRIB can't parse messages of type RTM_IFINFO, and omits them instead.
For example, a call to net.InterfaceByName("tun0") (in the net package) returns an error, even if tun0 exists.
The list returned by route.ParseRIB omits all the routing messages of type RTM_IFINFO, which in turn is because the library is trying to use the generic parseInterfaceMessage implementation in interface_classic.go, which doesn't work since DragonflyBSD's RTM_VERSION got bumped to 7 in commit 43a37315. Related: #34368.
I guess the solution will be to implement a Dragonfly-specific parseInterfaceMessage; this is already done for FreeBSD and OpenBSD.
Note: I think I know how to fix this, and hope to have a patch ready soon. I'm filing this bug first to organize my thoughts and in case it's helpful.
What version of Go are you using (
go version
)?Git commit f21be2fdc.
Does this issue reproduce with the latest release?
I haven't tried, but it almost certainly will, since no Dragonfly implementation of
parseInterfaceAddrMessage
is there.What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
route.ParseRIB
can't parse messages of typeRTM_IFINFO
, and omits them instead.For example, a call to
net.InterfaceByName("tun0")
(in thenet
package) returns an error, even iftun0
exists.The list returned by
route.ParseRIB
omits all the routing messages of typeRTM_IFINFO
, which in turn is because the library is trying to use the genericparseInterfaceMessage
implementation ininterface_classic.go
, which doesn't work since DragonflyBSD'sRTM_VERSION
got bumped to 7 in commit 43a37315. Related: #34368.I guess the solution will be to implement a Dragonfly-specific
parseInterfaceMessage
; this is already done for FreeBSD and OpenBSD.