Skip to content

Commit

Permalink
tools: Allow deleting of interfaces
Browse files Browse the repository at this point in the history
FRR reload does not allow removing interfaces as a complete context.
Instead it removes each corresponding line of the interface context.
However, this leads to errors when an interface is already removed on the system.
Since we can do "no interface <ifname>" inside frrouting, this change introduces the ability
to delete interfaces.

Signed-off-by: Julian Klaiber <[email protected]>
  • Loading branch information
Julian Klaiber committed Sep 3, 2024
1 parent 745cd3e commit 8c23b84
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/frr-reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -1740,10 +1740,12 @@ def compare_context_objects(newconf, running):
delete_bgpd = True
lines_to_del.append((running_ctx_keys, None))

# We cannot do 'no interface' or 'no vrf' in FRR, and so deal with it
elif running_ctx_keys[0].startswith("interface"):
lines_to_del.append((running_ctx_keys, None))

# We cannot do 'no vrf' in FRR, and so deal with it
elif (
running_ctx_keys[0].startswith("interface")
or running_ctx_keys[0].startswith("vrf")
running_ctx_keys[0].startswith("vrf")
or running_ctx_keys[0].startswith("router pim")
):
for line in running_ctx.lines:
Expand Down

0 comments on commit 8c23b84

Please sign in to comment.