github.com/containers/libpod@v1.9.4-0.20220419124438-4284fd425507/pkg/network/ip.go (about) 1 package network 2 3 import ( 4 "net" 5 6 "github.com/containernetworking/plugins/pkg/ip" 7 ) 8 9 // CalcGatewayIP takes a network and returns the first IP in it. 10 func CalcGatewayIP(ipn *net.IPNet) net.IP { 11 // taken from cni bridge plugin as it is not exported 12 nid := ipn.IP.Mask(ipn.Mask) 13 return ip.NextIP(nid) 14 }