Kaynağa Gözat

ResolveName should return copy of IPs

Signed-off-by: Santhosh Manohar <santhosh@docker.com>
Santhosh Manohar 8 yıl önce
ebeveyn
işleme
16af9918c0
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. 3 1
      libnetwork/network.go

+ 3 - 1
libnetwork/network.go

@@ -1645,7 +1645,9 @@ func (n *network) ResolveName(req string, ipType int) ([]net.IP, bool) {
 	}
 
 	if ip != nil {
-		return ip, false
+		ipLocal := make([]net.IP, len(ip))
+		copy(ipLocal, ip)
+		return ipLocal, false
 	}
 
 	return nil, ipv6Miss