mirror of
https://github.com/clearlinux/docker.git
synced 2026-08-26 18:17:24 +00:00
Vendoring libnetwork 5978c276ad20e104d6acd749da6ee6a8930055ae
- To bring in ip-range fix Signed-off-by: Alessandro Boch <aboch@docker.com> (cherry picked from commit 9c395537bce1e787ae34d90b2de81df3a47c5ff9)
This commit is contained in:
committed by
Tibor Vass
parent
da9b925066
commit
e0d0582d97
+1
-1
@@ -20,7 +20,7 @@ clone git github.com/tchap/go-patricia v2.1.0
|
||||
clone git golang.org/x/net 3cffabab72adf04f8e3b01c5baf775361837b5fe https://github.com/golang/net.git
|
||||
|
||||
#get libnetwork packages
|
||||
clone git github.com/docker/libnetwork 5305ea570b85d61dd0fd261cd7e1680da1884678
|
||||
clone git github.com/docker/libnetwork 5978c276ad20e104d6acd749da6ee6a8930055ae
|
||||
clone git github.com/armon/go-metrics eb0af217e5e9747e41dd5303755356b62d28e3ec
|
||||
clone git github.com/hashicorp/go-msgpack 71c2886f5a673a35f909803f38ece5810165097b
|
||||
clone git github.com/hashicorp/memberlist 9a1e242e454d2443df330bdd51a436d5a9058fc4
|
||||
|
||||
+1
-4
@@ -128,14 +128,11 @@ type ipamData struct {
|
||||
|
||||
type driverTable map[string]*driverData
|
||||
|
||||
//type networkTable map[string]*network
|
||||
//type endpointTable map[string]*endpoint
|
||||
type ipamTable map[string]*ipamData
|
||||
type sandboxTable map[string]*sandbox
|
||||
|
||||
type controller struct {
|
||||
id string
|
||||
//networks networkTable
|
||||
id string
|
||||
drivers driverTable
|
||||
ipamDrivers ipamTable
|
||||
sandboxes sandboxTable
|
||||
|
||||
@@ -220,7 +220,7 @@ func (a *Allocator) parsePoolRequest(addressSpace, pool, subPool string, v6 bool
|
||||
return nil, nil, nil, ipamapi.ErrInvalidPool
|
||||
}
|
||||
if subPool != "" {
|
||||
if ipr, err = getAddressRange(subPool); err != nil {
|
||||
if ipr, err = getAddressRange(subPool, nw); err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
}
|
||||
@@ -431,9 +431,6 @@ func (a *Allocator) ReleaseAddress(poolID string, address net.IP) error {
|
||||
aSpace.Unlock()
|
||||
|
||||
mask := p.Pool.Mask
|
||||
if p.Range != nil {
|
||||
mask = p.Range.Sub.Mask
|
||||
}
|
||||
|
||||
h, err := types.GetHostPartIP(address, mask)
|
||||
if err != nil {
|
||||
@@ -471,7 +468,6 @@ func (a *Allocator) getAddress(nw *net.IPNet, bitmask *bitseq.Handle, prefAddres
|
||||
ordinal = ipToUint64(types.GetMinimalIP(hostPart))
|
||||
err = bitmask.Set(ordinal)
|
||||
} else {
|
||||
base.IP = ipr.Sub.IP
|
||||
ordinal, err = bitmask.SetAnyInRange(ipr.Start, ipr.End)
|
||||
}
|
||||
if err != nil {
|
||||
|
||||
+3
-3
@@ -15,12 +15,12 @@ const (
|
||||
v6 = 6
|
||||
)
|
||||
|
||||
func getAddressRange(pool string) (*AddressRange, error) {
|
||||
func getAddressRange(pool string, masterNw *net.IPNet) (*AddressRange, error) {
|
||||
ip, nw, err := net.ParseCIDR(pool)
|
||||
if err != nil {
|
||||
return nil, ipamapi.ErrInvalidSubPool
|
||||
}
|
||||
lIP, e := types.GetHostPartIP(nw.IP, nw.Mask)
|
||||
lIP, e := types.GetHostPartIP(nw.IP, masterNw.Mask)
|
||||
if e != nil {
|
||||
return nil, fmt.Errorf("failed to compute range's lowest ip address: %v", e)
|
||||
}
|
||||
@@ -28,7 +28,7 @@ func getAddressRange(pool string) (*AddressRange, error) {
|
||||
if e != nil {
|
||||
return nil, fmt.Errorf("failed to compute range's broadcast ip address: %v", e)
|
||||
}
|
||||
hIP, e := types.GetHostPartIP(bIP, nw.Mask)
|
||||
hIP, e := types.GetHostPartIP(bIP, masterNw.Mask)
|
||||
if e != nil {
|
||||
return nil, fmt.Errorf("failed to compute range's highest ip address: %v", e)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user