summaryrefslogtreecommitdiffstats
path: root/src/vnet/srv6/sr_policy_rewrite.c
diff options
context:
space:
mode:
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);