diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-09-09 19:44:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-09 19:44:57 +0200 |
commit | 7042a3d7a539bae79ed63bdc87f432b8ec73afd8 (patch) | |
tree | 6f229373f5e436663c8908d0f2409fdbac2f6a2a /pkg/network/ip.go | |
parent | 511b0717454e0619d9d7d201cb10a41201cebef2 (diff) | |
parent | ee432cf2792c5dbe81953007f1fd5c87beb3ebd5 (diff) | |
download | podman-7042a3d7a539bae79ed63bdc87f432b8ec73afd8.tar.gz podman-7042a3d7a539bae79ed63bdc87f432b8ec73afd8.tar.bz2 podman-7042a3d7a539bae79ed63bdc87f432b8ec73afd8.zip |
Merge pull request #3862 from baude/networkcreate
podman network create
Diffstat (limited to 'pkg/network/ip.go')
-rw-r--r-- | pkg/network/ip.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/network/ip.go b/pkg/network/ip.go new file mode 100644 index 000000000..1798cd939 --- /dev/null +++ b/pkg/network/ip.go @@ -0,0 +1,14 @@ +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) +} |