]> git.puffer.fish Git - mirror/frr.git/commit
zebra: simplify and optimize vrf display in show ip route
authorChristophe Gouault <christophe.gouault@6wind.com>
Thu, 20 Aug 2020 09:15:33 +0000 (11:15 +0200)
committerIgor Ryzhov <iryzhov@nfware.com>
Tue, 6 Oct 2020 12:54:25 +0000 (15:54 +0300)
commit189248c22088a811638d85774d81189aa9bd19b7
tree04803d645c8d15fc043c74630a614a3c20ebc5be
parentb33d3f486c66e83cb60786689897e6d5ea6d943d
zebra: simplify and optimize vrf display in show ip route

In all outputs (text and json): simplify and optimize the vrf name
display, use the vrf_id_to_name() handler.

Note: vrf_id_to_name() has a safeguard system that prevents from
crashing when the vrf cannot be found because it changed in some
(unexpected) manner, it returns "n/a".

Note: "vrf n/a" will now be displayed instead of "vrf UNKNOWN" in this
case, like in most other frr components.

This safeguard was missing for show ip route json, so this
optimization also fixes a potential crash.

Signed-off-by: Christophe Gouault <christophe.gouault@6wind.com>
zebra/zebra_vty.c