- if (NULL != rewrite)
- {
- /*
- * new rewrite provided.
- * use a dummy rewrite header to get the interface to print into.
- */
- ip_adjacency_t dummy;
- dpo_id_t tmp = DPO_NULL;
-
- vnet_rewrite_for_tunnel(vnet_get_main(),
- adj->rewrite_header.sw_if_index,
- adj_get_midchain_node(adj->ia_link),
- adj->sub_type.midchain.tx_function_node,
- &dummy.rewrite_header,
- rewrite,
- vec_len(rewrite));
-
- /*
- * this is an update of an existing rewrite.
- * packets are in flight. we'll need to briefly stack on the drop DPO
- * whilst the rewrite is written, so any packets that see the partial update
- * are binned.
- */
- if (!dpo_id_is_valid(&adj->sub_type.midchain.next_dpo))
- {
- /*
- * not stacked yet. stack on the drop
- */
- dpo_stack(DPO_ADJACENCY_MIDCHAIN,
- fib_link_to_dpo_proto(adj->ia_link),
- &adj->sub_type.midchain.next_dpo,
- drop_dpo_get(fib_link_to_dpo_proto(adj->ia_link)));
- }
-
- dpo_copy(&tmp, &adj->sub_type.midchain.next_dpo);
- dpo_stack(DPO_ADJACENCY_MIDCHAIN,
- fib_link_to_dpo_proto(adj->ia_link),
- &adj->sub_type.midchain.next_dpo,
- drop_dpo_get(fib_link_to_dpo_proto(adj->ia_link)));
-
- CLIB_MEMORY_BARRIER();