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

addons: vrf: enforce reserved table id range 1001-5000

Ticket:
Reviewed By:
Testing Done: Tested vrf-table id with valid and invalid table ids

currently the reserved table id range is set to 1001-5000
and it comes from a policy file /var/lib/ifupdown2/policy.d/vrf.json
This commit is contained in:
Roopa Prabhu
2016-03-23 19:33:16 -07:00
parent c4be54818e
commit fd8c6caf7f

View File

@@ -429,13 +429,13 @@ class vrf(moduleBase):
# XXX: If we decide to not allow vrf id usages out of
# the reserved ifupdown range, then uncomment this code.
#else:
# if (int(vrf_table) < self.vrf_table_id_start or
# int(vrf_table) > self.vrf_table_id_end):
# self.log_error('%s: vrf table id %s out of reserved range [%d,%d]'
# %(ifaceobj.name, vrf_table,
# self.vrf_table_id_start,
# self.vrf_table_id_end))
else:
if (int(vrf_table) < self.vrf_table_id_start or
int(vrf_table) > self.vrf_table_id_end):
self.log_error('%s: vrf table id %s out of reserved range [%d,%d]'
%(ifaceobj.name, vrf_table,
self.vrf_table_id_start,
self.vrf_table_id_end))
try:
self.ipcmd.link_create(ifaceobj.name, 'vrf',
{'table' : '%s' %vrf_table})