]> 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)
committerChristophe Gouault <christophe.gouault@6wind.com>
Mon, 21 Sep 2020 08:07:56 +0000 (10:07 +0200)
commit6ac940417795da8dd73fc7817e509295b13fa7af
tree30849e5ccf907b5e363c6114e13d532a3be73139
parent7c1119cb7a1c66028d5487ff66682383244f987d
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