]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib, tools: fix reloading of key sub-context in key chains 6976/head
authorAlexander Chernavin <achernavin@netgate.com>
Mon, 24 Aug 2020 13:28:28 +0000 (09:28 -0400)
committerAlexander Chernavin <achernavin@netgate.com>
Mon, 24 Aug 2020 13:54:55 +0000 (09:54 -0400)
When you add a key chain in the RIP configuration file and reload the
configurations via the frr-reload.py script, the script will fail and
the key chain will not appear in the running configuration. The reason
is that frr-reload.py doesn't recognize key as a sub-context.

Before this change, keys were generated this way:

    key chain test
     key 2
      key-string 123
     key 3
      key-string 456

With this change, keys will be generated this way:

    key chain test
     key 2
      key-string 123
     exit
     key 3
      key-string 456
     exit

This will allow frr-reload.py to see the key sub-context and correctly
reload them.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
lib/keychain.c
tools/frr-reload.py

index 251211734bd766cc75903ee957e47bdb146ecc80..82fd6a65f2249989d3eb693643a692cd3d32bf96 100644 (file)
@@ -1041,6 +1041,8 @@ static int keychain_config_write(struct vty *vty)
                                }
                                vty_out(vty, "\n");
                        }
+
+                       vty_out(vty, " exit\n");
                }
                vty_out(vty, "!\n");
        }
index a72e5c2772d0ba608b9fb96be840df65115a87ad..8ffc313c04b2b4d0258c9832da7fb57eb3a90e17 100755 (executable)
@@ -591,6 +591,7 @@ end
                   line.startswith("vnc l2-group") or
                   line.startswith("vnc nve-group") or
                   line.startswith("peer") or
+                  line.startswith("key ") or
                   line.startswith("member pseudowire")):
                 main_ctx_key = []