Browse Source

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 years ago
parent
commit
1066f9ed5c
1 changed files with 2 additions and 2 deletions
  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,
 	}
 
-	d.vxlanIdm, err = idm.New(nil, "vxlan-id", vxlanIDStart, vxlanIDEnd)
+	d.vxlanIdm, err = idm.New(nil, "vxlan-id", 1, vxlanIDEnd)
 	if err != nil {
 		return fmt.Errorf("failed to initialize vxlan id manager: %v", err)
 	}
@@ -164,7 +164,7 @@ func (n *network) obtainVxlanID(s *subnet) error {
 	n.Unlock()
 
 	if vni == 0 {
-		vni, err = n.driver.vxlanIdm.GetID()
+		vni, err = n.driver.vxlanIdm.GetIDInRange(vxlanIDStart, vxlanIDEnd)
 		if err != nil {
 			return err
 		}