summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuhiro MIKI <nob@bobuhiro11.net>2025-01-29 04:31:53 +0000
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2025-01-29 12:06:15 +0000
commitf85d968a7ed6ac069bdfda28df4d8284117bbfad (patch)
treec2994d2f2627ec6fc13f8c92b6e94238432cdc9d
parent4110d5292eb6b482332df468d7fcffcdd0804067 (diff)
tools: Fix frr-reload for ebgp-multihop TTL reconfiguration.
In ebgp-multihop, there is a difference in reload behavior when TTL is unspecified (meaning default 255) and when 255 is explicitly specified. For example, when reloading with 'neighbor <neighbor> ebgp-multihop 255' in the config, the following difference is created. This commit fixes that. Lines To Delete =============== router bgp 65001 no neighbor 10.0.0.4 ebgp-multihop exit Lines To Add ============ router bgp 65001 neighbor 10.0.0.4 ebgp-multihop 255 exit The commit 767aaa3a8048 is not sufficient and frr-reload needs to be fixed to handle both unspecified and specified cases. Signed-off-by: Nobuhiro MIKI <nob@bobuhiro11.net> (cherry picked from commit 594e917656da5502b302309aed3cf596df24713f)
-rwxr-xr-xtools/frr-reload.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py
index 2590161b49..ea0ce6fc9c 100755
--- a/tools/frr-reload.py
+++ b/tools/frr-reload.py
@@ -237,6 +237,14 @@ def get_normalized_interface_vrf(line):
return line
+def get_normalized_ebgp_multihop_line(line):
+ obj = re.search(r"(.*)ebgp-multihop\s+255", line)
+ if obj:
+ line = obj.group(1) + "ebgp-multihop"
+
+ return line
+
+
# This dictionary contains a tree of all commands that we know start a
# new multi-line context. All other commands are treated either as
# commands inside a multi-line context or as single-line contexts. This
@@ -319,6 +327,9 @@ class Config(object):
if ":" in line:
line = get_normalized_mac_ip_line(line)
+ if "ebgp-multihop" in line:
+ line = get_normalized_ebgp_multihop_line(line)
+
# vrf static routes can be added in two ways. The old way is:
#
# "ip route x.x.x.x/x y.y.y.y vrf <vrfname>"