浏览代码

libnetwork/types: remove GetMinimalIPNet() as it's unused

This wass addded in https://github.com/moby/libnetwork/commit/4e48ff3aabbfbb8e6e164be753c055e4ced76e81
but never used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 3 年之前
父节点
当前提交
513310f776
共有 1 个文件被更改,包括 0 次插入15 次删除
  1. 0 15
      libnetwork/types/types.go

+ 0 - 15
libnetwork/types/types.go

@@ -342,21 +342,6 @@ func GetMinimalIP(ip net.IP) net.IP {
 	return ip
 }
 
-// GetMinimalIPNet returns a copy of the passed IP Network with congruent ip and mask notation
-func GetMinimalIPNet(nw *net.IPNet) *net.IPNet {
-	if nw == nil {
-		return nil
-	}
-	if len(nw.IP) == 16 && nw.IP.To4() != nil {
-		m := nw.Mask
-		if len(m) == 16 {
-			m = m[12:16]
-		}
-		return &net.IPNet{IP: nw.IP.To4(), Mask: m}
-	}
-	return nw
-}
-
 // IsIPNetValid returns true if the ipnet is a valid network/mask
 // combination. Otherwise returns false.
 func IsIPNetValid(nw *net.IPNet) bool {