summaryrefslogtreecommitdiffstats
path: root/lib/if.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-09-22 18:10:02 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-09-22 18:10:02 +0200
commitb1cc6da84fdddc1bc09277066df1727c5a782c70 (patch)
treecc9a395e9d06a1ed370f99aca67997b70b41c08b /lib/if.c
parentMerge pull request #3056 from pacovn/Coverity_1473285_Explicit_null_dereferenced (diff)
downloadfrr-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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/if.c b/lib/if.c
index 6b551a9fa..67e2d366c 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -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);