aboutsummaryrefslogtreecommitdiff
path: root/pkg/network/ip.go
blob: 1798cd939d54370ad1686990fc5879b47c71050d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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)
}