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.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/vnet/srv6/sr_policy_rewrite.c b/src/vnet/srv6/sr_policy_rewrite.c
index aa2f0670c51..feac151665a 100755
--- a/src/vnet/srv6/sr_policy_rewrite.c
+++ b/src/vnet/srv6/sr_policy_rewrite.c
@@ -2921,7 +2921,6 @@ sr_policy_rewrite_b_encaps (vlib_main_t * vm, vlib_node_runtime_t * node,
ip6_header_t *ip0, *ip1, *ip2, *ip3;
ip6_header_t *ip0_encap, *ip1_encap, *ip2_encap, *ip3_encap;
ip6_sr_header_t *sr0, *sr1, *sr2, *sr3;
- ip6_ext_header_t *prev0, *prev1, *prev2, *prev3;
ip6_sr_sl_t *sl0, *sl1, *sl2, *sl3;
/* Prefetch next iteration. */
@@ -2985,14 +2984,18 @@ sr_policy_rewrite_b_encaps (vlib_main_t * vm, vlib_node_runtime_t * node,
ip2_encap = vlib_buffer_get_current (b2);
ip3_encap = vlib_buffer_get_current (b3);
- ip6_ext_header_find_t (ip0_encap, prev0, sr0,
- IP_PROTOCOL_IPV6_ROUTE);
- ip6_ext_header_find_t (ip1_encap, prev1, sr1,
- IP_PROTOCOL_IPV6_ROUTE);
- ip6_ext_header_find_t (ip2_encap, prev2, sr2,
- IP_PROTOCOL_IPV6_ROUTE);
- ip6_ext_header_find_t (ip3_encap, prev3, sr3,
- IP_PROTOCOL_IPV6_ROUTE);
+ sr0 =
+ ip6_ext_header_find (vm, b0, ip0_encap, IP_PROTOCOL_IPV6_ROUTE,
+ NULL);
+ sr1 =
+ ip6_ext_header_find (vm, b1, ip1_encap, IP_PROTOCOL_IPV6_ROUTE,
+ NULL);
+ sr2 =
+ ip6_ext_header_find (vm, b2, ip2_encap, IP_PROTOCOL_IPV6_ROUTE,
+ NULL);
+ sr3 =
+ ip6_ext_header_find (vm, b3, ip3_encap, IP_PROTOCOL_IPV6_ROUTE,
+ NULL);
end_bsid_encaps_srh_processing (node, b0, ip0_encap, sr0, &next0);
end_bsid_encaps_srh_processing (node, b1, ip1_encap, sr1, &next1);
@@ -3078,7 +3081,6 @@ sr_policy_rewrite_b_encaps (vlib_main_t * vm, vlib_node_runtime_t * node,
u32 bi0;
vlib_buffer_t *b0;
ip6_header_t *ip0 = 0, *ip0_encap = 0;
- ip6_ext_header_t *prev0;
ip6_sr_header_t *sr0;
ip6_sr_sl_t *sl0;
u32 next0 = SR_POLICY_REWRITE_NEXT_IP6_LOOKUP;
@@ -3098,8 +3100,9 @@ sr_policy_rewrite_b_encaps (vlib_main_t * vm, vlib_node_runtime_t * node,
vec_len (sl0->rewrite));
ip0_encap = vlib_buffer_get_current (b0);
- ip6_ext_header_find_t (ip0_encap, prev0, sr0,
- IP_PROTOCOL_IPV6_ROUTE);
+ sr0 =
+ ip6_ext_header_find (vm, b0, ip0_encap, IP_PROTOCOL_IPV6_ROUTE,
+ NULL);
end_bsid_encaps_srh_processing (node, b0, ip0_encap, sr0, &next0);
clib_memcpy_fast (((u8 *) ip0_encap) - vec_len (sl0->rewrite),