Skip to content

Commit a7fe161

Browse files
committed
net: don't use syscall.NET_RT_IFLISTL on FreeBSD
The golang.org/x/net/route package can't parse the RIB returned by NET_RT_IFLISTL. Use the route.RIBTypeInterface constant instead, leaving the choice of syscall up to the route package. Fixes #48553. Change-Id: Ida4bd6e332c0dc6dc871d3a93cfb56c0fbc93e1b Reviewed-on: https://go-review.googlesource.com/c/go/+/353611 Trust: Damien Neil <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Go Bot <[email protected]>
1 parent 07a7c6f commit a7fe161

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/net/interface_freebsd.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,11 @@ import (
1111
)
1212

1313
func interfaceMessages(ifindex int) ([]route.Message, error) {
14-
typ := route.RIBType(syscall.NET_RT_IFLISTL)
15-
rib, err := route.FetchRIB(syscall.AF_UNSPEC, typ, ifindex)
14+
rib, err := route.FetchRIB(syscall.AF_UNSPEC, route.RIBTypeInterface, ifindex)
1615
if err != nil {
17-
typ = route.RIBType(syscall.NET_RT_IFLIST)
18-
rib, err = route.FetchRIB(syscall.AF_UNSPEC, typ, ifindex)
19-
if err != nil {
20-
return nil, err
21-
}
16+
return nil, err
2217
}
23-
return route.ParseRIB(typ, rib)
18+
return route.ParseRIB(route.RIBTypeInterface, rib)
2419
}
2520

2621
// interfaceMulticastAddrTable returns addresses for a specific

0 commit comments

Comments
 (0)