Skip to content

Commit

Permalink
tools: Fix frr-reload for ebgp-multihop TTL reconfiguration.
Browse files Browse the repository at this point in the history
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 767aaa3 is not sufficient and frr-reload needs to be
fixed to handle both unspecified and specified cases.

Signed-off-by: Nobuhiro MIKI <[email protected]>
  • Loading branch information
bobuhiro11 committed Jan 29, 2025
1 parent ee67699 commit 594e917
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tools/frr-reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -382,6 +390,9 @@ def load_from_file(self, filename):
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>"
Expand Down

0 comments on commit 594e917

Please sign in to comment.