summaryrefslogtreecommitdiffstats
path: root/src/vnet/srv6/sr_policy_rewrite.c
diff options
context:
space:
mode:
authorKris Michielsen <kmichiel@cisco.com>2017-06-22 13:00:20 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2017-08-22 11:12:34 +0000
commit910744394f2529ecac0fa91a16237777e023c5e6 (patch)
tree7b9dc698753656ee5b1fc834b984a0449544bd5c /src/vnet/srv6/sr_policy_rewrite.c
parent5f22f4ddded8ac41487dab3069ff8d77c3916205 (diff)
SRv6 tests
Change-Id: Ib1d2fc5a83d9d007a0468591a73881675f1bec9b Signed-off-by: Kris Michielsen <kmichiel@cisco.com>
Diffstat (limited to 'src/vnet/srv6/sr_policy_rewrite.c')
-rwxr-xr-xsrc/vnet/srv6/sr_policy_rewrite.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vnet/srv6/sr_policy_rewrite.c b/src/vnet/srv6/sr_policy_rewrite.c
index 7a37a66b402..f427bbf379c 100755
--- a/src/vnet/srv6/sr_policy_rewrite.c
+++ b/src/vnet/srv6/sr_policy_rewrite.c
@@ -672,7 +672,8 @@ sr_policy_del (ip6_address_t * bsid, u32 index)
segment_list = pool_elt_at_index (sm->sid_lists, *sl_index);
vec_free (segment_list->segments);
vec_free (segment_list->rewrite);
- vec_free (segment_list->rewrite_bsid);
+ if (!sr_policy->is_encap)
+ vec_free (segment_list->rewrite_bsid);
pool_put_index (sm->sid_lists, *sl_index);
}
@@ -766,7 +767,8 @@ sr_policy_mod (ip6_address_t * bsid, u32 index, u32 fib_table,
segment_list = pool_elt_at_index (sm->sid_lists, sl_index);
vec_free (segment_list->segments);
vec_free (segment_list->rewrite);
- vec_free (segment_list->rewrite_bsid);
+ if (!sr_policy->is_encap)
+ vec_free (segment_list->rewrite_bsid);
pool_put_index (sm->sid_lists, sl_index);
vec_del1 (sr_policy->segments_lists,
sl_index_iterate - sr_policy->segments_lists);