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

Comments

Projects
None yet
5 participants
@mappu
Copy link

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  . :
@mikioh

This comment has been minimized.

Copy link
Contributor

commented Mar 15, 2017

I think @alexbrainman is familiar than me with TestInterfaceHardwareAddrWithGetmac.

@mikioh mikioh removed their assignment Mar 15, 2017

@alexbrainman

This comment has been minimized.

Copy link
Member

commented Mar 15, 2017

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

Alex

@alexbrainman

This comment has been minimized.

Copy link
Member

commented Mar 21, 2017

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

This comment has been minimized.

Copy link
Author

commented Mar 21, 2017

@mappu

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Member

commented Mar 21, 2017

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

This comment has been minimized.

Copy link
Member

commented Mar 31, 2017

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

Alex

@gopherbot

This comment has been minimized.

Copy link

commented Mar 31, 2017

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

@alexbrainman

This comment has been minimized.

Copy link
Member

commented May 5, 2017

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

Alex

@mappu

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Member

commented May 8, 2017

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

@gopherbot gopherbot closed this in 0927b47 May 18, 2017

@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.
You can’t perform that action at this time.