]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_mpls_vty.c
Merge branch 'cmaster-next' into vtysh-grammar
[mirror_frr.git] / zebra / zebra_mpls_vty.c
index 061bb244b2357c7e20f05e030642d22febe6e93c..ff84c59432598bcc1d4c11372fbbfef44d407832 100644 (file)
@@ -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);