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: TestInterfaceHardwareAddrWithGetmac fails if Hyper-V bridges are present #19537

Closed
mappu opened this issue Mar 14, 2017 · 11 comments
Closed
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. OS-Windows Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@mappu
Copy link

mappu commented Mar 14, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version devel +ec091b6 Mon Mar 13 23:43:16 2017 +0000 windows/amd64

What operating system and processor architecture are you using (go env)?

set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\dev\gopath
set GORACE=
set GOROOT=C:\gotip
set GOTOOLDIR=C:\gotip\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\cygwin\tmp\go-build067613091=/tmp/go-build -gno-record-gcc-switches
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config

What did you do?

all.bat

What did you expect to see?

Test success

What did you see instead?

Test failure:

--- FAIL: TestInterfaceHardwareAddrWithGetmac (1.22s)
        net_windows_test.go:599: getmac lists "Ethernet 3", but it could not be found among Go interfaces map[vEthernet (DockerNAT):0x:1x:5x:1x:7x:1x vEthernet (Hyper-V Bridge):1x:1x:0x:0x:6x:7x Teredo Tunneling Pseudo-Interface:00:00:00:00:00:00:00:e0 isatap.fritz.box:00:00:00:00:00:00:00:e0 isatap.{1XXX5XXX-DXXX-4XXX-9XXX-CXXX1XXX4XXX}:00:00:00:00:00:00:00:e0]
FAIL
FAIL    net     6.980s

I guess it's a similar problem as in #14130 (comment) although that was closed already.

For me "Ethernet 3" does appear in the output of getmac /fo list /v, but, it does not appear in ipconfig.

I assume it's caused by the presence of a Hyper-V bridge, that's the only unusual thing about my network configuration.

C:\>getmac /fo list /v

Connection Name:  vEthernet (Hyper-V Bridge)
Network Adapter:  Hyper-V Virtual Ethernet Adapter #2
Physical Address: 1X-1X-0X-0X-6X-7X
Transport Name:   \Device\Tcpip_{2XXXAXXX-3XXX-4XXX-AXXX-4XXX4XXX7XXX}

Connection Name:  vEthernet (DockerNAT)
Network Adapter:  Hyper-V Virtual Ethernet Adapter #3
Physical Address: 0X-1X-5X-1X-7X-1X
Transport Name:   \Device\Tcpip_{1XXX5XXX-DXXX-4XXX-9XXX-CXXX1XXX4XXX}

Connection Name:  Ethernet 3
Network Adapter:  Realtek PCIe GBE Family Controller
Physical Address: 1X-1X-0X-0X-6X-7X
Transport Name:   N/A

C:\>ipconfig

Windows IP Configuration


Ethernet adapter vEthernet (DockerNAT):

   Connection-specific DNS Suffix  . :
   IPv4 Address. . . . . . . . . . . : 10.0.X.X
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Ethernet adapter vEthernet (Hyper-V Bridge):

   Connection-specific DNS Suffix  . : fritz.box
   IPv6 Address. . . . . . . . . . . : 2XXX:eXXX:3XXX...
   Temporary IPv6 Address. . . . . . : 2XXX:eXXX:3XXX...
   Temporary IPv6 Address. . . . . . : 2XXX:eXXX:3XXX...
   Link-local IPv6 Address . . . . . : fe80::[...]%4
   IPv4 Address. . . . . . . . . . . : 172.30.X.X
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : fe80::[...]%4
                                       172.30.X.X

Tunnel adapter Teredo Tunneling Pseudo-Interface:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter isatap.fritz.box:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : fritz.box

Tunnel adapter isatap.{1XXX5XXX-DXXX-4XXX-9XXX-CXXX1XXX4XXX}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
@bradfitz bradfitz added help wanted NeedsFix The path to resolution is known, but the work has not been done. OS-Windows labels Mar 14, 2017
@bradfitz bradfitz added this to the Go1.9 milestone Mar 14, 2017
@bradfitz bradfitz added the Testing An issue that has been verified to require only test changes, not just a test failure. label Mar 14, 2017
@mikioh
Copy link
Contributor

mikioh commented Mar 15, 2017

I think @alexbrainman is familiar than me with TestInterfaceHardwareAddrWithGetmac.

@mikioh mikioh removed their assignment Mar 15, 2017
@alexbrainman
Copy link
Member

I am away from my computers. I will look at this next week.

Alex

@alexbrainman
Copy link
Member

Maybe we could skip adapter with

Transport Name: N/A

in its description.

Alternatively, maybe we could use wmic command instead of getmac. @mappu what does this command

wmic nic list full

outputs? Thank you.

Alex

@mappu
Copy link
Author

mappu commented Mar 21, 2017

Machine in question has this output:

https://gist.github.com/mappu/165e9497ac66c0e097414a6be779d07d

@mappu
Copy link
Author

mappu commented Mar 21, 2017

I think skipping the adapter in getmac would be a reasonable solution (unless the N/A string changes on different-language version of Windows?)

@alexbrainman
Copy link
Member

https://gist.github.com/mappu/165e9497ac66c0e097414a6be779d07d

Thank you for that. Unfortunately I don't see how we can use that. Do you?

unless the N/A string changes on different-language version of Windows

If you look at the code, you will see that we already only running this test if we have English version of getmac.

So skipping adapter that has "Transport Name: N/A" string in its description seems like the only way to fix this. Maybe other gophers will suggest something different. If not I will send a change.

Alex

@alexbrainman
Copy link
Member

@mappu , please, try https://go-review.googlesource.com/39071 . Does it fixes your problem?
Thank you.

Alex

@gopherbot
Copy link

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

@alexbrainman
Copy link
Member

@mappu should I submit https://golang.org/cl/39071 or not?

Alex

@mappu
Copy link
Author

mappu commented May 6, 2017

Hi,

I set up a new Windows machine in the same configuration (Hyper-V Virtual Switch) and rebuilt go from git source.

Check master (4b2f7b4b51) has still the original issue:

--- FAIL: TestInterfaceHardwareAddrWithGetmac (4.42s)
        net_windows_test.go:604: getmac lists "Ethernet", but it could not be found among Go interfaces map[vEthernet (New Virtual Switch):1x:6x:6x:dx:9x:ex Teredo Tunneling Pseudo-Interface:00:00:00:00:00:00:00:ex]
FAIL
FAIL    net     31.643s

Obtain CL version:

$ git fetch https://go.googlesource.com/go refs/changes/71/39071/1 && git checkout FETCH_HEAD

Build CL version:

ok      net     21.958s

So i agree the CL does fix the issue.

Please do merge it because it's my only single test failure.

Thanks for your work

@alexbrainman
Copy link
Member

So i agree the CL does fix the issue.

Thank you for checking. Hopefully someone will review my CL and it will get submitted soon.

Alex

@golang golang locked and limited conversation to collaborators May 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. OS-Windows Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

5 participants