diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-09-22 18:10:02 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-09-22 18:10:02 +0200 |
commit | b1cc6da84fdddc1bc09277066df1727c5a782c70 (patch) | |
tree | cc9a395e9d06a1ed370f99aca67997b70b41c08b /lib/if.c | |
parent | Merge pull request #3056 from pacovn/Coverity_1473285_Explicit_null_dereferenced (diff) | |
download | frr-b1cc6da84fdddc1bc09277066df1727c5a782c70.tar.xz frr-b1cc6da84fdddc1bc09277066df1727c5a782c70.zip |
lib: Allow useful display of default vrf name
When entering a interface name and you fat-finger it
actually display some useful information about the vrf
we are in.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/if.c')
-rw-r--r-- | lib/if.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -656,7 +656,8 @@ DEFUN_NOSH (interface, int idx_ifname = 1; int idx_vrf = 3; const char *ifname = argv[idx_ifname]->arg; - const char *vrfname = (argc > 2) ? argv[idx_vrf]->arg : NULL; + const char *vrfname = + (argc > 2) ? argv[idx_vrf]->arg : VRF_DEFAULT_NAME; struct interface *ifp; vrf_id_t vrf_id = VRF_DEFAULT; @@ -681,7 +682,8 @@ DEFUN_NOSH (interface, #endif /* SUNOS_5 */ if (!ifp) { - vty_out(vty, "%% interface %s not in %s\n", ifname, vrfname); + vty_out(vty, "%% interface %s not in %s vrf\n", ifname, + vrfname); return CMD_WARNING_CONFIG_FAILED; } VTY_PUSH_CONTEXT(INTERFACE_NODE, ifp); |