]> Cypherpunks repositories - gostls13.git/commitdiff
net: ignore unnamed interfaces on DragonFly
authorIan Lance Taylor <iant@golang.org>
Tue, 4 Feb 2025 22:23:14 +0000 (14:23 -0800)
committerGopher Robot <gobot@golang.org>
Wed, 5 Feb 2025 00:52:20 +0000 (16:52 -0800)
On DragonFly it seems that we can see an unnamed interface,
but be unable to retrieve it. Skip unnamed interface cases.

For #71064

Change-Id: Ie9af74bd656d403ddc19cc5f14062cd8e0fa2571
Reviewed-on: https://go-review.googlesource.com/c/go/+/646675
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>

src/internal/routebsd/interface_classic.go

index af9531c0df7ee7ca38f18571b70980efe0a82122..2599e5dd591358c740f180f64a6e1ec934a1540a 100644 (file)
@@ -41,6 +41,12 @@ func (w *wireFormat) parseInterfaceMessage(b []byte) (Message, error) {
                }
                m.Addrs[syscall.RTAX_IFP] = a
                m.Name = a.(*LinkAddr).Name
+       } else {
+               // DragonFly seems to have unnamed interfaces
+               // that we can't look up again. Just skip them.
+               if runtime.GOOS == "dragonfly" {
+                       return nil, nil
+               }
        }
 
        return m, nil