]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib, zebra: Keep `zebra on-rib-process script` in frr.conf
authorDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 18 Oct 2024 12:36:52 +0000 (15:36 +0300)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Sun, 27 Oct 2024 23:24:59 +0000 (23:24 +0000)
After the change:

```
$ grep on-rib-process /etc/frr/frr.conf
zebra on-rib-process script script4

$ systemctl restart frr

$ vtysh -c 'show run' | grep on-rib-process
zebra on-rib-process script script4
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 1fe1f8d87c4ab46ae18536a2418c05ae5fd95185)

lib/frrscript.c
lib/frrscript.h
zebra/zebra_vty.c

index acdd1df67b4d0d0b4d09ad26cf7729f911811772..878431cac5de93b5127412ba33a754848489cfd3 100644 (file)
@@ -27,6 +27,16 @@ struct frrscript_names_head frrscript_names_hash;
 
 void _lua_decode_noop(lua_State *L, ...) {}
 
+void frrscript_names_config_write(struct vty *vty)
+{
+       struct frrscript_names_entry *lua_script_entry;
+
+       frr_each (frrscript_names, &frrscript_names_hash, lua_script_entry)
+               if (lua_script_entry->script_name[0] != '\0')
+                       vty_out(vty, "zebra on-rib-process script %s\n",
+                               lua_script_entry->script_name);
+}
+
 /*
  * Wrapper for frrscript_names_add
  * Use this to register hook calls when a daemon starts up
index ce313a1b63a86e60aba6985aa751d024b3f5bcfb..75ac53c6092acfe8d9e4e331352b890660995484 100644 (file)
@@ -44,6 +44,8 @@ struct frrscript_names_entry {
 
 extern struct frrscript_names_head frrscript_names_hash;
 
+extern void frrscript_names_config_write(struct vty *vty);
+
 int frrscript_names_hash_cmp(const struct frrscript_names_entry *snhe1,
                             const struct frrscript_names_entry *snhe2);
 uint32_t frrscript_names_hash_key(const struct frrscript_names_entry *snhe);
index 9a68d5ae9db4039dc1d25696d2da0c04b10a5724..bd1faa789b982099cda827eb069a3770b145e34e 100644 (file)
@@ -3822,6 +3822,10 @@ static int config_write_protocol(struct vty *vty)
        if (!zebra_nhg_recursive_use_backups())
                vty_out(vty, "no zebra nexthop resolve-via-backup\n");
 
+#ifdef HAVE_SCRIPTING
+       frrscript_names_config_write(vty);
+#endif
+
        if (rnh_get_hide_backups())
                vty_out(vty, "ip nht hide-backup-events\n");