Skip to content

net: Interfaces returns no interfaces on DragonFly BSD #81503

Open

Description

@sigttou

Go version

go1.27.1 dragonfly/amd64

Output of go env in your module/workspace:

GOOS=dragonfly
GOARCH=amd64
GOVERSION=go1.27.1

What did you do?

Call net.Interfaces() on DragonFly BSD:

package main

import (
    "fmt"
    "net"
)

func main() {
    ifs, err := net.Interfaces()
    fmt.Println("count:", len(ifs), "err:", err)
}

What did you see happen?

count: 0

What did you expect to see?

The system's interfaces, e.g. em0, lo0, pflog0, pfsync0, tailscale0.

Additional context

internal/routebsd/interface_classic.go is compiled for darwin, dragonfly and
netbsd, and reads the if_msghdr/ifa_msghdr fields at the FreeBSD/darwin
offsets (addrs at offset 4, index at offset 12). DragonFly orders these
differently: ifm_index comes right after the message type (offset 4) and
ifm_addrs after the flags (offset 12). So the parser reads the index from the
addrs field and drops messages that lack the RTA_IFP bit, and net.Interfaces()
reports nothing.

This appears to have regressed when internal/routebsd was split out of
x/net/route (Go 1.26). Fix CL: https://go-review.googlesource.com/c/go/+/831784

Activity

  1. gopherbot commented on Sep 13, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/831784 mentions this issue: internal/routebsd: fix interface parsing on DragonFly BSD

  2. added
    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
    on Sep 15, 2026
  3. seankhliao commented on Sep 15, 2026

    @seankhliao
    Member

    cc @golang/dragonfly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions