From fac32cda5af7adcf0400f1fd8763764a498149f3 Mon Sep 17 00:00:00 2001 From: ezbercih Date: Thu, 21 Mar 2013 00:11:16 -0300 Subject: [PATCH] Fix issue #120, initialize TCPAddr w/ field names Current Go tip (+74e65f07a0c8) and likely Go 1.1 does not build docker since net.TCPAddr struct has an additional field now for IPv6: type TCPAddr struct { IP IP Port int Zone string // IPv6 scoped addressing zone } Initializing the struct with named fields resolves this problem. --- network.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network.go b/network.go index 1b6395b0b1..a109a70239 100644 --- a/network.go +++ b/network.go @@ -279,7 +279,7 @@ func (iface *NetworkInterface) AllocatePort(port int) (int, error) { if err != nil { return -1, err } - if err := iface.manager.portMapper.Map(extPort, net.TCPAddr{iface.IPNet.IP, port}); err != nil { + if err := iface.manager.portMapper.Map(extPort, net.TCPAddr{IP: iface.IPNet.IP, Port: port}); err != nil { iface.manager.portAllocator.Release(extPort) return -1, err }