]> git.puffer.fish Git - matthieu/frr.git/commit
zebra: fix show route memory consumption
authorLouis Scalbert <louis.scalbert@6wind.com>
Fri, 24 May 2024 14:34:23 +0000 (16:34 +0200)
committerLouis Scalbert <louis.scalbert@6wind.com>
Fri, 7 Jun 2024 08:13:32 +0000 (10:13 +0200)
commit85eb60ffd6ce40428c3a99aeddf46b1b60d2e0a5
tree4f6baa4821eb9e7e4d9e469a99e8811c13a2d8c0
parentcb440058f2d85d1408f932ad820c38e8e1b17191
zebra: fix show route memory consumption

When displaying a route table in JSON, a table JSON object is storing
all the prefix JSON objects containing the prefix information. This
results in excessive memory allocation for JSON objects, potentially
leading to an out-of-memory error on the machine with large routing
tables.

To Fix the memory consumption issue for the "show ip[v6] route [vrf XX]
json" command, display the prefixes one by one and free the memory of
each JSON object after it has been displayed.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
zebra/zebra_vty.c