diff options
| author | Pablo Neira Ayuso <pablo@netfilter.org> | 2024-10-31 21:38:02 +0100 |
|---|---|---|
| committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2024-11-05 21:57:18 +0100 |
| commit | 193faa5475a5df7d9ac0b1a8fe647196de3e5688 (patch) | |
| tree | 9477a08597765474ea50f884faed2c54a1481917 /tests | |
| parent | 0373ca62be3c11a58bd462ee0689718ad25142b6 (diff) | |
json: collapse set element commands from parser
Update json parser to collapse {add,create} element commands to reduce
memory consumption in the case of large sets defined by one element per
command:
{"nftables": [{"add": {"element": {"family": "ip", "table": "x", "name":
"y", "elem": [{"set": ["1.1.0.0"]}]}}},...]}
Add CTX_F_COLLAPSED flag to report that command has been collapsed.
This patch reduces memory consumption by ~32% this case.
Fixes: 20f1c60ac8c8 ("src: collapse set element commands from parser")
Reported-by: Eric Garver <eric@garver.life>
Tested-by: Eric Garver <eric@garver.life>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions
