aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/srmpls/sr_mpls_policy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/srmpls/sr_mpls_policy.c')
-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,