Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: ParseMAC cannot parse 20-octet IP over InfiniBand link-layer address #11763

mdlayher opened this issue Jul 17, 2015 · 1 comment


None yet
4 participants
Copy link

commented Jul 17, 2015

At the moment, net.ParseMAC cannot accept 20-octet IP over InfiniBand link-layer addresses, though they are correctly parsed into net.Interface.

$ ip addr show ib0
4: ib0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 4092 qdisc pfifo_fast state DOWN group default qlen 256
    link/infiniband 80:00:00:48:fe:80:00:00:00:00:00:00:00:02:c9:03:00:50:5e:d5 brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff

Here is an example program:

package main

import (

var (
        ifaceFlag = flag.String("i", "ib0", "network interface name")

func main() {
        ifi, err := net.InterfaceByName(*ifaceFlag)
        if err != nil {

        log.Printf("%s: %s", ifi.Name, ifi.HardwareAddr)

        mac, err := net.ParseMAC(ifi.HardwareAddr.String())
        if err != nil {

        log.Println("%s: %s", ifi.Name, mac)

Here is the output as of Go 1.4.2:

$ go build
$ ./ibmac 
2015/07/17 17:11:34 ib0: 80:00:00:48:fe:80:00:00:00:00:00:00:00:02:c9:03:00:50:5e:d5
2015/07/17 17:11:34 invalid MAC address: 80:00:00:48:fe:80:00:00:00:00:00:00:00:02:c9:03:00:50:5e:d5

I will submit a changelist which should fix this issue shortly.


This comment has been minimized.

Copy link

commented Jul 17, 2015

CL mentions this issue.

@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Jul 17, 2015

@mdlayher mdlayher changed the title net: ParseMAC cannot parse 160 bit Infiniband hardware address net: ParseMAC cannot parse 20-octet IP over InfiniBand link-layer address Jul 18, 2015

@bradfitz bradfitz modified the milestones: Go1.6, Unplanned Jul 19, 2015

@bradfitz bradfitz closed this in 759210b Aug 24, 2015

@golang golang locked and limited conversation to collaborators Aug 24, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.