You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ go version
go version devel +master Thu Jun 25 19:13:01 EDT 2020 plan9/amd64
What did you do?
Create a packet interface. For example, 6in4(8) and tinc(8) creates them by writing bind pkt to the interface control file.
Note that the device name in the interface status file is pkt2:
It does skip this for the loopback interface (/dev/null device), but it should also skip for packet interfaces. Maybe it should just skip anything without a /net/ prefix.
fhs
changed the title
net: net.Interfaces() fails on Plan 9 if there is a packet interface
net: Interfaces() fails on Plan 9 if there is a packet interface
Jun 29, 2020
cpu% cd src/net
cpu% go test -short
--- FAIL: TestInterfaces (0.00s)
interface_test.go:56: route ip+net: open pkt2/addr: 'pkt2' './home/big/go/src/net/pkt2' does not exist
--- FAIL: TestInterfaceAddrs (0.00s)
interface_test.go:87: route ip+net: open pkt2/addr: 'pkt2' './home/big/go/src/net/pkt2' does not exist
--- FAIL: TestInterfaceUnicastAddrs (0.00s)
interface_test.go:106: route ip+net: open pkt2/addr: 'pkt2' './home/big/go/src/net/pkt2' does not exist
--- FAIL: TestInterfaceMulticastAddrs (0.00s)
interface_test.go:133: route ip+net: open pkt2/addr: 'pkt2' './home/big/go/src/net/pkt2' does not exist
FAIL
exit status: 'net.test 11992: 1'
FAIL net 40.497s
What version of Go are you using (
go version
)?What did you do?
bind pkt
to the interface control file.Note that the device name in the interface status file is
pkt2
:net.Interfaces()
in a Go program.What did you expect to see?
nil error
What did you see instead?
Error returned:
The code is assuming
pkt2
is a path to a network device (e.g./net/ether0
) and tries to openpkt2/addr
to read in theInterface.HardwareAddr
:go/src/net/interface_plan9.go
Lines 71 to 76 in c875503
It does skip this for the loopback interface (
/dev/null
device), but it should also skip for packet interfaces. Maybe it should just skip anything without a/net/
prefix.@gopherbot add labels OS-Plan9, NeedsFix
The text was updated successfully, but these errors were encountered: