summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDinesh G Dutt <ddutt@cumulusnetworks.com>2016-12-13 11:46:52 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-01-30 19:40:04 +0100
commit78e31f4663d413a7ab18bb9c4b77e55fc8007396 (patch)
treedfd96b2a366293d9b31e03afcb60d6cc764cacb1 /tools
parentMerge pull request #121 from opensourcerouting/snapcraft-packaging (diff)
downloadfrr-78e31f4663d413a7ab18bb9c4b77e55fc8007396.tar.xz
frr-78e31f4663d413a7ab18bb9c4b77e55fc8007396.zip
tools: Fix unnecessary routing perturbations due to old style config
Ticket: CM-14060 Reviewed By: Testing Done: There are two harmful problems (cause routing changes in the network) with the 2.5.x style config: one with the old style specification of "multipath as-relax", and the other with ip import-table, used by redistribute neighbor In 2.5, we had the user specify 'no-as-set' as the suffix to 'bgp bestpath as-path multipath relax' to avoid quagga's default behavior which'd cause weird routing problems. However, in 3.x, we made 'no-as-set' as the default, and so its neither required to specify it nor is it shown in the running config. This means when we do quagga reload, we remove the multipath as-relax line and add it back with the no-as-set line. This causes all BGP sessions to be reset. The problem with the "ip import-table" is that it causes us to unimport the routes and then add it back again, causing routing prefix changes throughout the network, potentially causing blackholing of traffic. This fix addresses both these issues and avoids the unnecessary routing blips. Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/frr-reload.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py
index 463784de1..e14d78d54 100755
--- a/tools/frr-reload.py
+++ b/tools/frr-reload.py
@@ -579,6 +579,41 @@ def ignore_delete_re_add_lines(lines_to_add, lines_to_del):
lines_to_add_to_del.append((ctx_keys, swpx_interface))
lines_to_add_to_del.append((tmp_ctx_keys, swpx_remoteas))
+ '''
+ In 3.0, we made bgp bestpath multipath as-relax command
+ automatically assume no-as-set since the lack of this option caused
+ weird routing problems and this problem was peculiar to this
+ implementation. When the running config is shown in relases after
+ 3.0, the no-as-set is not shown as its the default. This causes
+ reload to unnecessarily unapply this option to only apply it back
+ again, causing unnecessary session resets. Handle this.
+ '''
+ if ctx_keys[0].startswith('router bgp') and line and 'multipath-relax' in line:
+ re_asrelax_new = re.search('^bgp\s+bestpath\s+as-path\s+multipath-relax$', line)
+ old_asrelax_cmd = 'bgp bestpath as-path multipath-relax no-as-set'
+ found_asrelax_old = line_exist(lines_to_add, ctx_keys, old_asrelax_cmd)
+
+ if re_asrelax_new and found_asrelax_old:
+ deleted = True
+ lines_to_del_to_del.append((ctx_keys, line))
+ lines_to_add_to_del.append((ctx_keys, old_asrelax_cmd))
+
+ '''
+ More old-to-new config handling. ip import-table no longer accepts
+ distance, but we honor the old syntax. But 'show running' shows only
+ the new syntax. This causes an unnecessary 'no import-table' followed
+ by the same old 'ip import-table' which causes perturbations in
+ announced routes leading to traffic blackholes. Fix this issue.
+ '''
+ re_importtbl = re.search('^ip\s+import-table\s+(\d+)$', ctx_keys[0])
+ if re_importtbl:
+ table_num = re_importtbl.group(1)
+ for ctx in lines_to_add:
+ if ctx[0][0].startswith('ip import-table %s distance' % table_num):
+ deleted = True
+ lines_to_del_to_del.append((('ip import-table %s' % table_num,), None))
+ lines_to_add_to_del.append((ctx[0], None))
+
if not deleted:
found_add_line = line_exist(lines_to_add, ctx_keys, line)