From a89455d2de5283e74280a85cdbf2ac4ab72fef3d Mon Sep 17 00:00:00 2001 From: Arko Dasgupta Date: Sat, 23 Jan 2021 12:00:46 -0800 Subject: [PATCH] Use hostIP to decide on Portmapper version Use HostIP to decide which portmapper object to store the binding in consistently in the allocate and release method (https://github.com/moby/libnetwork/blob/448016ef11309bd67541dcf4d72f1f5b7de94862/drivers/bridge/port_mapping.go#L208) Signed-off-by: Arko Dasgupta --- drivers/bridge/port_mapping.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bridge/port_mapping.go b/drivers/bridge/port_mapping.go index c68d3dcbb9..946130ecdd 100644 --- a/drivers/bridge/port_mapping.go +++ b/drivers/bridge/port_mapping.go @@ -139,7 +139,7 @@ func (n *bridgeNetwork) allocatePort(bnd *types.PortBinding, ulPxyEnabled bool) portmapper := n.portMapper - if bnd.IP.To4() == nil { + if bnd.HostIP.To4() == nil { portmapper = n.portMapperV6 }