Skip to content

lua: review Lua libraries and examples#561

Merged
AltraMayor merged 4 commits intov1.1-devfrom
run-tests
Jun 3, 2022
Merged

lua: review Lua libraries and examples#561
AltraMayor merged 4 commits intov1.1-devfrom
run-tests

Conversation

@AltraMayor
Copy link
Owner

No description provided.

The struct in_addrd and struct in6_addr were being defined in
lua/gatekeeper/dylib.lua and lua/gatekeeper/policylib, so
a Lua script that included both libraries would raise
the error "attempt to redefine 'in_addr'".

This error was first seen in
script lua/examples/example_gt_lpm_params_request.lua.
This patch makes set_log_level_per_block() return the number of
instances affected by the change. This information is useful to
check that the function worked.

Without this patch, the script
lua/examples/example_of_dynamic_config_request.lua would fail
with the following output:

./gkctl ../lua/examples/example_of_dynamic_config_request.lua
[string "message"]:48: attempt to compare nil with number
The functions dylib.print_fib_dump_entry(),
dylib.print_neighbor_dump_entry(), and dylib.print_lls_dump_entry()
have changed a while ago, but example_of_dynamic_config_request.lua
had not been updated to reflect those changes.
@AltraMayor AltraMayor added the Operational demand This issue would make Gatekeeper safer and/or cheaper to operate label Jun 2, 2022
@AltraMayor AltraMayor added this to the Version 1.1 milestone Jun 2, 2022
@AltraMayor AltraMayor merged commit 2062ca2 into v1.1-dev Jun 3, 2022
@AltraMayor AltraMayor deleted the run-tests branch June 3, 2022 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Operational demand This issue would make Gatekeeper safer and/or cheaper to operate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant