Commit 8fc9c504 authored by Mikio Hara's avatar Mikio Hara Committed by Brad Fitzpatrick

net: update doc for unimplemented feature on Plan 9

Also removes unnecessary allocation.

Change-Id: I3406cf75a7b64d93b2b99c7f1f5c78f580452b60
Reviewed-on: https://go-review.googlesource.com/30891
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 29c600bb
...@@ -13,8 +13,8 @@ import ( ...@@ -13,8 +13,8 @@ import (
// BUG(mikio): On NaCl, methods and functions related to // BUG(mikio): On NaCl, methods and functions related to
// Interface are not implemented. // Interface are not implemented.
// BUG(mikio): On DragonFly BSD, NetBSD, OpenBSD and Solaris, the // BUG(mikio): On DragonFly BSD, NetBSD, OpenBSD, Plan 9 and Solaris,
// MulticastAddrs method of Interface is not implemented. // the MulticastAddrs method of Interface is not implemented.
var ( var (
errInvalidInterface = errors.New("invalid network interface") errInvalidInterface = errors.New("invalid network interface")
......
...@@ -132,7 +132,7 @@ func interfaceCount() (int, error) { ...@@ -132,7 +132,7 @@ func interfaceCount() (int, error) {
// network interfaces. Otherwise it returns addresses for a specific // network interfaces. Otherwise it returns addresses for a specific
// interface. // interface.
func interfaceAddrTable(ifi *Interface) ([]Addr, error) { func interfaceAddrTable(ifi *Interface) ([]Addr, error) {
ifcs := []Interface{} var ifcs []Interface
if ifi == nil { if ifi == nil {
var err error var err error
ifcs, err = interfaceTable(0) ifcs, err = interfaceTable(0)
...@@ -177,8 +177,7 @@ func interfaceAddrTable(ifi *Interface) ([]Addr, error) { ...@@ -177,8 +177,7 @@ func interfaceAddrTable(ifi *Interface) ([]Addr, error) {
if !ok { if !ok {
return nil, errors.New("cannot parse network mask for interface: " + status) return nil, errors.New("cannot parse network mask for interface: " + status)
} }
mask := CIDRMask(int(pfxlen), 128) var mask IPMask
if ip.To4() != nil { // IPv4 or IPv6 IPv4-mapped address if ip.To4() != nil { // IPv4 or IPv6 IPv4-mapped address
mask = CIDRMask(pfxlen-8*len(v4InV6Prefix), 8*IPv4len) mask = CIDRMask(pfxlen-8*len(v4InV6Prefix), 8*IPv4len)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment