mirror of
https://github.com/containers/podman.git
synced 2025-12-05 12:52:12 +08:00
vendor in latests containers/common
To include export HostContainersInternal Signed-off-by: Black-Hole1 <bh@bugs.cc>
This commit is contained in:
7
vendor/github.com/containers/common/libnetwork/netavark/config.go
generated
vendored
7
vendor/github.com/containers/common/libnetwork/netavark/config.go
generated
vendored
@@ -187,12 +187,11 @@ func (n *netavarkNetwork) networkCreate(newNetwork *types.Network, defaultNet bo
|
||||
}
|
||||
|
||||
case types.IsolateOption:
|
||||
val, err := strconv.ParseBool(value)
|
||||
val, err := internalutil.ParseIsolate(value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// rust only support "true" or "false" while go can parse 1 and 0 as well so we need to change it
|
||||
newNetwork.Options[types.IsolateOption] = strconv.FormatBool(val)
|
||||
newNetwork.Options[types.IsolateOption] = val
|
||||
case types.MetricOption:
|
||||
_, err := strconv.ParseUint(value, 10, 32)
|
||||
if err != nil {
|
||||
@@ -244,7 +243,7 @@ func (n *netavarkNetwork) networkCreate(newNetwork *types.Network, defaultNet bo
|
||||
return nil, err
|
||||
}
|
||||
|
||||
//validate routes
|
||||
// validate routes
|
||||
err = internalutil.ValidateRoutes(newNetwork.Routes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
21
vendor/github.com/containers/common/libnetwork/netavark/ipam.go
generated
vendored
21
vendor/github.com/containers/common/libnetwork/netavark/ipam.go
generated
vendored
@@ -173,20 +173,23 @@ func getFreeIPFromBucket(bucket *bbolt.Bucket, subnet *types.Subnet) (net.IP, er
|
||||
if rangeStart == nil {
|
||||
// let start with the first ip in subnet
|
||||
rangeStart = util.NextIP(subnet.Subnet.IP)
|
||||
} else if util.Cmp(rangeStart, subnet.Subnet.IP) == 0 {
|
||||
// when we start on the subnet ip we need to inc by one as the subnet ip cannot be assigned
|
||||
rangeStart = util.NextIP(rangeStart)
|
||||
}
|
||||
|
||||
lastIP, err := util.LastIPInSubnet(&subnet.Subnet.IPNet)
|
||||
// this error should never happen but lets check anyways to prevent panics
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get lastIP: %w", err)
|
||||
}
|
||||
if rangeEnd == nil {
|
||||
lastIP, err := util.LastIPInSubnet(&subnet.Subnet.IPNet)
|
||||
// this error should never happen but lets check anyways to prevent panics
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get lastIP: %w", err)
|
||||
}
|
||||
// ipv4 uses the last ip in a subnet for broadcast so we cannot use it
|
||||
if util.IsIPv4(lastIP) {
|
||||
lastIP = util.PrevIP(lastIP)
|
||||
}
|
||||
rangeEnd = lastIP
|
||||
}
|
||||
// ipv4 uses the last ip in a subnet for broadcast so we cannot use it
|
||||
if util.IsIPv4(rangeEnd) && util.Cmp(rangeEnd, lastIP) == 0 {
|
||||
rangeEnd = util.PrevIP(rangeEnd)
|
||||
}
|
||||
|
||||
lastIPByte := bucket.Get(lastIPKey)
|
||||
curIP := net.IP(lastIPByte)
|
||||
|
||||
Reference in New Issue
Block a user