Browse code

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.

ezbercih authored on 2013/03/21 12:11:16
Showing 1 changed files
... ...
@@ -279,7 +279,7 @@ func (iface *NetworkInterface) AllocatePort(port int) (int, error) {
279 279
 	if err != nil {
280 280
 		return -1, err
281 281
 	}
282
-	if err := iface.manager.portMapper.Map(extPort, net.TCPAddr{iface.IPNet.IP, port}); err != nil {
282
+	if err := iface.manager.portMapper.Map(extPort, net.TCPAddr{IP: iface.IPNet.IP, Port: port}); err != nil {
283 283
 		iface.manager.portAllocator.Release(extPort)
284 284
 		return -1, err
285 285
 	}