aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-09-18 18:04:10 -0700
committerNeale Ranns <nranns@cisco.com>2017-10-25 18:38:42 +0000
commitde08cd6a1c9e16dc30abcb30c4b519afda626208 (patch)
tree06f5c7a03da3db723b03a099078ef6fabeea675f
parent30ef35e636ac8946c80f710098b6333afa199e64 (diff)
Treat label=0 as an invalid next-hop-via-label
Change-Id: I831226111d26f5c8a795e0773e23fddcddfb1613 Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit caac350076e386e5caf6322a3439ea0c36d77cc5)
-rw-r--r--src/vnet/ip/ip_api.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/vnet/ip/ip_api.c b/src/vnet/ip/ip_api.c
index 2680d6010dc..fde636c9357 100644
--- a/src/vnet/ip/ip_api.c
+++ b/src/vnet/ip/ip_api.c
@@ -734,7 +734,13 @@ add_del_route_t_handler (u8 is_multipath,
fib_route_path_t *paths = NULL;
fib_entry_flag_t entry_flags = FIB_ENTRY_FLAG_NONE;
- if (MPLS_LABEL_INVALID != next_hop_via_label)
+ /*
+ * the special INVALID label meams we are not recursing via a
+ * label. Exp-null value is never a valid via-label so that
+ * also means it's not a via-label and means clients that set
+ * it to 0 by default get the expected behaviour
+ */
+ if ((MPLS_LABEL_INVALID != next_hop_via_label) && (0 != next_hop_via_label))
{
path.frp_proto = FIB_PROTOCOL_MPLS;
path.frp_local_label = next_hop_via_label;