summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-08-29 03:05:17 -0700
committerJohn Lo <loj@cisco.com>2018-08-29 21:54:51 +0000
commitead8eb34e305b7bb145f7a113107010f28cdc954 (patch)
treedb2661ca2c3e32b11d26022e70fce99874a9939d
parent19d4ecddeba8f5d04bd61bc1a891ed7e14325592 (diff)
SR-mpls: do not pass empty label stack to fib
Change-Id: Ib1601d01a54296e72be3bbfa057fce965549b02b Signed-off-by: Neale Ranns <nranns@cisco.com>
-rwxr-xr-xsrc/vnet/srmpls/sr_mpls_policy.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/vnet/srmpls/sr_mpls_policy.c b/src/vnet/srmpls/sr_mpls_policy.c
index 7d336c17594..5bb7fb2bff5 100755
--- a/src/vnet/srmpls/sr_mpls_policy.c
+++ b/src/vnet/srmpls/sr_mpls_policy.c
@@ -85,20 +85,21 @@ create_sl (mpls_sr_policy_t * sr_policy, mpls_label_t * sl, u32 weight)
.frp_local_label = sl[0],
};
- vec_add (path.frp_label_stack, sl + 1, vec_len (sl) - 1);
+ if (vec_len (sl) - 1)
+ vec_add (path.frp_label_stack, sl + 1, vec_len (sl) - 1);
fib_route_path_t *paths = NULL;
vec_add1 (paths, path);
- /* *INDENT-OFF* */
- fib_prefix_t pfx = {
- .fp_len = 21,
- .fp_proto = FIB_PROTOCOL_MPLS,
- .fp_label = sr_policy->bsid,
- .fp_eos = eos,
- .fp_payload_proto = DPO_PROTO_MPLS,
- };
- /* *INDENT-ON* */
+ /* *INDENT-OFF* */
+ fib_prefix_t pfx = {
+ .fp_len = 21,
+ .fp_proto = FIB_PROTOCOL_MPLS,
+ .fp_label = sr_policy->bsid,
+ .fp_eos = eos,
+ .fp_payload_proto = DPO_PROTO_MPLS,
+ };
+ /* *INDENT-ON* */
fib_table_entry_path_add2 (0,
&pfx,