From 4f4caaa1390593d8d3ce45be915187943d53e0bf Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 25 Oct 2016 14:43:07 -0400 Subject: [PATCH] zebra: Allow v6 static routes to handle mpls not in kernel When configuring v6 static routes, allow it to gracefully ignore mpls commands when mpls is not turned on in the kernel. Signed-off-by: Donald Sharp --- zebra/zebra_vty.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 6a43da39b3..9b0fad93e0 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -3734,7 +3734,6 @@ static_config_ipv4 (struct vty *vty, safi_t safi, const char *cmd) return write; } -#ifdef HAVE_IPV6 /* General fucntion for IPv6 static route. */ int static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, @@ -3793,6 +3792,12 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, memset (&snh_label, 0, sizeof (struct static_nh_label)); 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)) { @@ -5841,7 +5846,6 @@ static_config_ipv6 (struct vty *vty) } return write; } -#endif /* HAVE_IPV6 */ DEFUN (allow_external_route_update, allow_external_route_update_cmd, -- 2.39.5