summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-04-15 14:57:03 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-04-15 19:26:56 +0200
commitbf995813b2176819aa5816d8935cf73aeb2f7d51 (patch)
tree5283619b010c77c5d26413b9d468d22b4b706d99
parentzebra: Fix crash with dereference of NULL pointer (diff)
downloadfrr-bf995813b2176819aa5816d8935cf73aeb2f7d51.tar.xz
frr-bf995813b2176819aa5816d8935cf73aeb2f7d51.zip
zebra: Allow explicit-null as a label option
When entering 'mpls label bind ...' command allow the explicit-null as an option. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--zebra/zebra_mpls_vty.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/zebra/zebra_mpls_vty.c b/zebra/zebra_mpls_vty.c
index f46037487..ae1de8be2 100644
--- a/zebra/zebra_mpls_vty.c
+++ b/zebra/zebra_mpls_vty.c
@@ -243,6 +243,13 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix,
if (!strcmp(label_str, "implicit-null"))
label = MPLS_IMP_NULL_LABEL;
+ else if (!strcmp(label_str, "explicit-null"))
+ {
+ if (p.family == AF_INET)
+ label = MPLS_V4_EXP_NULL_LABEL;
+ else
+ label = MPLS_V6_EXP_NULL_LABEL;
+ }
else
{
label = atoi(label_str);
@@ -276,14 +283,15 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix,
DEFUN (mpls_label_bind,
mpls_label_bind_cmd,
- "mpls label bind <A.B.C.D/M|X:X::X:X/M> <(16-1048575)|implicit-null>",
+ "mpls label bind <A.B.C.D/M|X:X::X:X/M> <(16-1048575)|implicit-null|explicit-null>",
MPLS_STR
"Label configuration\n"
"Establish FEC to label binding\n"
"IPv4 prefix\n"
"IPv6 prefix\n"
"MPLS Label to bind\n"
- "Use Implicit-Null Label\n")
+ "Use Implicit-Null Label\n"
+ "Use Explicit-Null Label\n")
{
return zebra_mpls_bind (vty, 1, argv[3]->arg, argv[4]->arg);
}