]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tools: fix frr-reload AF issue with ldpd
authorEmanuele Di Pascale <emanuele@voltanet.io>
Mon, 27 Apr 2020 13:47:03 +0000 (15:47 +0200)
committerEmanuele Di Pascale <emanuele@voltanet.io>
Mon, 27 Apr 2020 14:38:29 +0000 (16:38 +0200)
when removing a whole address-family block from ldpd config
we were erroneously trying to also remove each of the interface
sub-sub-contexts that belonged to it; this would effectively
re-enable the AF we just removed. Work around this by ignoring
these sub-sub-contexts if we detect that we are already
removing the parent block.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
tools/frr-reload.py

index 45843faf1363a3aca281a3b1aea8edb89d666ba2..1f9f42538680ae35c72e68ef1de3c56349b132e0 100755 (executable)
@@ -1077,6 +1077,13 @@ def compare_context_objects(newconf, running):
                 add_cmd = ('no ' + running_ctx_keys[0],)
                 lines_to_add.append((add_cmd, None))
 
+            # if this an interface sub-subcontext in an address-family block in ldpd and
+            # we are already deleting the whole context, then ignore this
+            elif (len(running_ctx_keys) > 2 and running_ctx_keys[0].startswith('mpls ldp') and
+                  running_ctx_keys[1].startswith('address-family') and
+                  (running_ctx_keys[:2], None) in lines_to_del):
+                continue
+
             # Non-global context
             elif running_ctx_keys and not any("address-family" in key for key in running_ctx_keys):
                 lines_to_del.append((running_ctx_keys, None))