1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

ifupdown2 fixes for svcnode, vxlan-ageing, bridge-vlan-aware

Ticket: CM-6815, CM-6816, CM-6817
Reviewed By: CCR-3234
Testing Done: unit testing

CM-6815 : ip link set syntax for svcnode has been changed. Absence of svcnode
will retain the existing values. svcnode 0.0.0.0 is needed to wipe out service
node addresses in vxlan device. Modified ifupdown2 to use svcnode 0.0.0.0 to
clean up service node address.

CM-6816: "bridge-clan-aware no" is not handled in query-check and hence ifquery
on bridge interface with "bridge-vlan-aware no" fails. Modified bridge's
query-check to take care of this.

CM-6817: With default ageing value (300), if query -c <vxlan device> was
failing. Set ageing to 300 if not specified and compare it with running config.
This commit is contained in:
Balakrishnan Raman
2015-07-23 12:15:16 -07:00
parent 65e0c27674
commit 27f2a937d8
3 changed files with 12 additions and 7 deletions

View File

@ -1284,8 +1284,9 @@ class bridge(moduleBase):
rv = runningattrs.get(k[7:])
if k == 'bridge-mcqv4src':
continue
if k == 'bridge-vlan-aware' and v == 'yes':
if self.ipcmd.bridge_is_vlan_aware(ifaceobj.name):
if k == 'bridge-vlan-aware':
rv = self.ipcmd.bridge_is_vlan_aware(ifaceobj.name)
if (rv and v == 'yes') or (not rv and v == 'no'):
ifaceobjcurr.update_config_with_status('bridge-vlan-aware',
v, 0)
else:

View File

@ -29,7 +29,8 @@ class vxlan(moduleBase):
'default': 'on'},
'vxlan-ageing' :
{'help' : 'vxlan aging timer',
'example': ['vxlan-ageing 300']},
'example': ['vxlan-ageing 300'],
'default': '300'},
}}
def __init__(self, *args, **kargs):
@ -110,10 +111,6 @@ class vxlan(moduleBase):
ifaceobj.get_attr_value('vxlan-remoteip'),
vxlanattrs.get('remote', []))
self._query_check_n_update(ifaceobjcurr, 'vxlan-ageing',
ifaceobj.get_attr_value('vxlan-ageing'),
vxlanattrs.get('ageing'))
learning = ifaceobj.get_attr_value_first('vxlan-learning')
if not learning:
learning = 'on'
@ -124,6 +121,11 @@ class vxlan(moduleBase):
else:
ifaceobjcurr.update_config_with_status('vxlan-learning',
running_learning, 1)
ageing = ifaceobj.get_attr_value_first('vxlan-ageing')
if not ageing:
ageing = self.get_mod_subattr('vxlan-ageing', 'default')
self._query_check_n_update(ifaceobjcurr, 'vxlan-ageing',
ageing, vxlanattrs.get('ageing'))
def _query_running(self, ifaceobjrunning):
vxlanattrs = self.ipcmd.get_vxlandev_attrs(ifaceobjrunning.name)

View File

@ -505,6 +505,8 @@ class iproute2(utilsBase):
args += ' nolearning'
if self.link_exists(name):
if not svcnodeips:
args += ' svcnode 0.0.0.0'
cmd = 'link set dev %s type vxlan dstport %d' %(name, VXLAN_UDP_PORT)
else:
cmd = 'link add dev %s type vxlan id %s dstport %d' %(name, vxlanid, VXLAN_UDP_PORT)