summaryrefslogtreecommitdiff
path: root/lib/frrscript.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2021-08-10 10:11:35 -0400
committerGitHub <noreply@github.com>2021-08-10 10:11:35 -0400
commitbde0fd77d9bc3bfbbd64222b210d1353f377a024 (patch)
tree3c9694ebb21635e3702f0f0c64e73cc6365aea9f /lib/frrscript.c
parent227ffdfe61e4ee9901d03b426916fde920246c89 (diff)
parent5141fd7f8e034081f3e1a2f391dd43d664c0412c (diff)
Merge pull request #9348 from dlqs/consecutive
lib: lua: consecutive script calls
Diffstat (limited to 'lib/frrscript.c')
-rw-r--r--lib/frrscript.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/frrscript.c b/lib/frrscript.c
index c9fc938997..0e0d3c030c 100644
--- a/lib/frrscript.c
+++ b/lib/frrscript.c
@@ -288,13 +288,16 @@ int frrscript_load(struct frrscript *fs, const char *function_name,
goto fail;
}
- /* Push the Lua function we want */
+ /* To check the Lua function, we get it from the global table */
lua_getglobal(L, function_name);
if (lua_isfunction(L, lua_gettop(L)) == 0) {
zlog_err("frrscript: loaded script '%s.lua' but %s not found",
script_name, function_name);
goto fail;
}
+ /* Then pop the function (frrscript_call will push it when it needs it)
+ */
+ lua_pop(L, 1);
if (load_cb && (*load_cb)(fs) != 0) {
zlog_err(