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: golang 1.5 mac address on Windows has additional :00:00 #12691

Closed
sathishvj opened this issue Sep 19, 2015 · 3 comments
Closed

net: golang 1.5 mac address on Windows has additional :00:00 #12691

sathishvj opened this issue Sep 19, 2015 · 3 comments

Comments

@sathishvj
Copy link

I'd written a program in go 1.4 to retrieve mac addresses on windows and used to get the correct mac address.
With 1.5.1 however, I'm seeing a :00:00 appended to all the mac addresses on Windows (specifically Windows 7 Professional).

Is there a reason for this (or is it simply an error on my side)?

 ifs, _ := net.Interfaces()
 for _, v := range ifs {
     h := v.HardwareAddr.String()
     if len(h) == 0 {
         continue
     }
     si.Macs = append(si.Macs, h)
 }

Bjorn Graf in this thread reports: "on my Windows 10 Go 1.5,x (amd64 and 386) seems to find only the loopback pseudo-Interface with an all-00 mac while go1.4.2 lists the real interface."

@ianlancetaylor ianlancetaylor changed the title golang 1.5 mac address on Windows has additional :00:00 net: golang 1.5 mac address on Windows has additional :00:00 Sep 19, 2015
@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Sep 19, 2015
@ianlancetaylor
Copy link
Contributor

CC @mikioh @alexbrainman

@gopherbot
Copy link

CL https://golang.org/cl/14747 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/17412 mentions this issue.

alexbrainman added a commit that referenced this issue Dec 9, 2015
Use Windows getmac command to verify interface
MAC addresses net package returns.

The test is to be enabled once issue #12691 is fixed.

Updates #12691

Change-Id: Ic28c83303590cb4d48ee025250d4b6e30683bfd4
Reviewed-on: https://go-review.googlesource.com/17632
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@mikioh mikioh closed this as completed in e05b48e Dec 10, 2015
@golang golang locked and limited conversation to collaborators Dec 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants