aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/srmpls
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 22:44:14 +0000
commit3b23e9d5af4f02836b689286824c9217fa2aa19a (patch)
tree556433e7b18db10c23e599ed9c8e08308a679556 /src/vnet/srmpls
parent1e3417f72f5b7b6a5b056f75477d6d536196c34a (diff)
SR-mpls: do not pass empty label stack to fib
Change-Id: Ib1601d01a54296e72be3bbfa057fce965549b02b Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/srmpls')
-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,