diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-10-25 14:25:29 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-10-25 14:30:25 -0400 |
| commit | c58418c1107928a851aee28b98acae306b79c6e3 (patch) | |
| tree | a9240706dc26a352833bb0b461925b1f95d99c97 /zebra/zebra_vty.c | |
| parent | 5697001a7b6860418ae2641a276238ba1dd76af6 (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_vty.c')
| -rw-r--r-- | zebra/zebra_vty.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 6002b0d6fa..6a43da39b3 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -118,6 +118,12 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, /* Labels */ if (label_str) { + if (!mpls_enabled) + { + vty_out (vty, "%% MPLS not turned on in kernel, ignoring command%s", + VTY_NEWLINE); + return CMD_WARNING; + } if (mpls_str2label (label_str, &snh_label.num_labels, snh_label.label)) { |
