mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
libnetwork/types: remove GetMinimalIPNet() as it's unused
This wass addded in 4e48ff3aab
but never used.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
2b70006e3b
commit
513310f776
1 changed files with 0 additions and 15 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue