Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
falsifian opened this issue Jun 9, 2021 · 1 comment
Open

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

falsifian opened this issue Jun 9, 2021 · 1 comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Dragonfly
Milestone

Comments

@falsifian
Copy link

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.

@tklauser tklauser added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Dragonfly labels Jun 10, 2021
@gopherbot
Copy link

Change https://golang.org/cl/328331 mentions this issue: x/net: Fix interface message parsing for dfly RTM_VERSION 7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Dragonfly
Projects
None yet
Development

No branches or pull requests

4 participants