Ver código fonte

IDM need not be bound by default vxlan-id start index

This will allow users to use the full spectrum of vxlan-ids

Signed-off-by: Madhu Venugopal <madhu@docker.com>
Madhu Venugopal 8 anos atrás
pai
commit
1066f9ed5c
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      libnetwork/drivers/overlay/ovmanager/ovmanager.go

+ 2 - 2
libnetwork/drivers/overlay/ovmanager/ovmanager.go

@@ -57,7 +57,7 @@ func Init(dc driverapi.DriverCallback, config map[string]interface{}) error {
 		config:   config,
 		config:   config,
 	}
 	}
 
 
-	d.vxlanIdm, err = idm.New(nil, "vxlan-id", vxlanIDStart, vxlanIDEnd)
+	d.vxlanIdm, err = idm.New(nil, "vxlan-id", 1, vxlanIDEnd)
 	if err != nil {
 	if err != nil {
 		return fmt.Errorf("failed to initialize vxlan id manager: %v", err)
 		return fmt.Errorf("failed to initialize vxlan id manager: %v", err)
 	}
 	}
@@ -164,7 +164,7 @@ func (n *network) obtainVxlanID(s *subnet) error {
 	n.Unlock()
 	n.Unlock()
 
 
 	if vni == 0 {
 	if vni == 0 {
-		vni, err = n.driver.vxlanIdm.GetID()
+		vni, err = n.driver.vxlanIdm.GetIDInRange(vxlanIDStart, vxlanIDEnd)
 		if err != nil {
 		if err != nil {
 			return err
 			return err
 		}
 		}