mirror of
https://github.com/containers/podman.git
synced 2025-06-02 02:26:52 +08:00

initial implementation of network create. we only support bridging networks with this first pass. Signed-off-by: baude <bbaude@redhat.com>
15 lines
305 B
Go
15 lines
305 B
Go
package network
|
|
|
|
import (
|
|
"net"
|
|
|
|
"github.com/containernetworking/plugins/pkg/ip"
|
|
)
|
|
|
|
// CalcGatewayIP takes a network and returns the first IP in it.
|
|
func CalcGatewayIP(ipn *net.IPNet) net.IP {
|
|
// taken from cni bridge plugin as it is not exported
|
|
nid := ipn.IP.Mask(ipn.Mask)
|
|
return ip.NextIP(nid)
|
|
}
|