diff options
author | Ian Lance Taylor <iant@google.com> | 2016-02-03 21:58:02 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-02-03 21:58:02 +0000 |
commit | f98dd1a338867a408f7c72d73fbad7fe7fc93e3a (patch) | |
tree | 2f8da9862a9c1fe0df138917f997b03439c02773 /libgo/go/net/mac.go | |
parent | b081ed4efc144da0c45a6484aebfd10e0eb9fda3 (diff) | |
download | gcc-f98dd1a338867a408f7c72d73fbad7fe7fc93e3a.zip gcc-f98dd1a338867a408f7c72d73fbad7fe7fc93e3a.tar.gz gcc-f98dd1a338867a408f7c72d73fbad7fe7fc93e3a.tar.bz2 |
libgo: Update to go1.6rc1.
Reviewed-on: https://go-review.googlesource.com/19200
From-SVN: r233110
Diffstat (limited to 'libgo/go/net/mac.go')
-rw-r--r-- | libgo/go/net/mac.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libgo/go/net/mac.go b/libgo/go/net/mac.go index 8594a91..93f0b09 100644 --- a/libgo/go/net/mac.go +++ b/libgo/go/net/mac.go @@ -24,14 +24,17 @@ func (a HardwareAddr) String() string { return string(buf) } -// ParseMAC parses s as an IEEE 802 MAC-48, EUI-48, or EUI-64 using one of the -// following formats: +// ParseMAC parses s as an IEEE 802 MAC-48, EUI-48, EUI-64, or a 20-octet +// IP over InfiniBand link-layer address using one of the following formats: // 01:23:45:67:89:ab // 01:23:45:67:89:ab:cd:ef +// 01:23:45:67:89:ab:cd:ef:00:00:01:23:45:67:89:ab:cd:ef:00:00 // 01-23-45-67-89-ab // 01-23-45-67-89-ab-cd-ef +// 01-23-45-67-89-ab-cd-ef-00-00-01-23-45-67-89-ab-cd-ef-00-00 // 0123.4567.89ab // 0123.4567.89ab.cdef +// 0123.4567.89ab.cdef.0000.0123.4567.89ab.cdef.0000 func ParseMAC(s string) (hw HardwareAddr, err error) { if len(s) < 14 { goto error @@ -42,7 +45,7 @@ func ParseMAC(s string) (hw HardwareAddr, err error) { goto error } n := (len(s) + 1) / 3 - if n != 6 && n != 8 { + if n != 6 && n != 8 && n != 20 { goto error } hw = make(HardwareAddr, n) @@ -58,7 +61,7 @@ func ParseMAC(s string) (hw HardwareAddr, err error) { goto error } n := 2 * (len(s) + 1) / 5 - if n != 6 && n != 8 { + if n != 6 && n != 8 && n != 20 { goto error } hw = make(HardwareAddr, n) |