Skip to content

x/net/route: parseInterfaceMessage broken on Dragonfly #46674

@falsifian

Description

@falsifian

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 f21be2f.

falsifian angel-dfly go $ bin/go version
go version go1.16 dragonfly/amd64

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 Output
falsifian angel-dfly go $ bin/go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/falsifian/.cache/go-build"
GOENV="/home/falsifian/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="dragonfly"
GOINSECURE=""
GOMODCACHE="/home/falsifian/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="dragonfly"
GOPATH="/home/falsifian/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/falsifian/src/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/falsifian/src/go/pkg/tool/dragonfly_amd64"
GOVCS=""
GOVERSION="go1.16"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1287776679=/tmp/go-build -gno-record-gcc-switches"

What did you do?

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.OS-Dragonfly

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions