Clan SA was saying:
./zebra/zebra_vty_clippy.c: In function ‘show_route’:
zebra/zebra_vty.c:1775:4: warning: ‘zvrf’ may be used uninitialized in this function [-Wmaybe-uninitialized]
do_show_ip_route_all(vty, zvrf, afi, !!fib, !!json, tag,
^
I do not see a way that zvrf could ever be uninited in the code path
but rearrange the code a tiny bit to make it happier.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
if (vrf_name)
VRF_GET_ID(vrf_id, vrf_name, !!json);
vrf = vrf_lookup_by_id(vrf_id);
- if (vrf)
- zvrf = vrf->info;
- if (!vrf || !zvrf)
+ if (!vrf)
+ return CMD_SUCCESS;
+
+ zvrf = vrf->info;
+ if (!zvrf)
return CMD_SUCCESS;
if (table_all)