diff options
author | Neale Ranns <nranns@cisco.com> | 2018-08-29 03:05:17 -0700 |
---|---|---|
committer | John Lo <loj@cisco.com> | 2018-08-29 21:54:51 +0000 |
commit | ead8eb34e305b7bb145f7a113107010f28cdc954 (patch) | |
tree | db2661ca2c3e32b11d26022e70fce99874a9939d /src/vnet | |
parent | 19d4ecddeba8f5d04bd61bc1a891ed7e14325592 (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')
-rwxr-xr-x | src/vnet/srmpls/sr_mpls_policy.c | 21 |
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, |