summaryrefslogtreecommitdiff
path: root/zebra/zebra_mpls_vty.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-10-25 14:25:29 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-10-25 14:30:25 -0400
commitc58418c1107928a851aee28b98acae306b79c6e3 (patch)
treea9240706dc26a352833bb0b461925b1f95d99c97 /zebra/zebra_mpls_vty.c
parent5697001a7b6860418ae2641a276238ba1dd76af6 (diff)
zebra: Disable mpls slightly different
When mpls is not turned on in the kernel, we are not installing the mpls commands into the cli. This results in vtysh attempting to run the command and receiving a 'WTF is this command' back from zebra. Modify the mpls code to install commands and to check to see if the command should be accepted based upon mpls working or not. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_mpls_vty.c')
-rw-r--r--zebra/zebra_mpls_vty.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/zebra/zebra_mpls_vty.c b/zebra/zebra_mpls_vty.c
index 6e95236c20..8b967c3af8 100644
--- a/zebra/zebra_mpls_vty.c
+++ b/zebra/zebra_mpls_vty.c
@@ -52,6 +52,13 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str,
mpls_label_t label;
mpls_label_t in_label, out_label;
+ if (!mpls_enabled)
+ {
+ vty_out (vty, "%% MPLS not turned on in kernel, ignoring command%s",
+ VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
zvrf = vrf_info_lookup(VRF_DEFAULT);
if (!zvrf)
{
@@ -829,9 +836,6 @@ zebra_mpls_vty_init (void)
{
install_element (VIEW_NODE, &show_mpls_status_cmd);
- if (! mpls_enabled)
- return;
-
install_node (&mpls_node, zebra_mpls_config);
install_element (CONFIG_NODE, &ip_route_label_cmd);