diff --git a/dash-pipeline/bmv2/stages/routing_action_apply.p4 b/dash-pipeline/bmv2/stages/routing_action_apply.p4 index cc5a808a8..2db38fc49 100644 --- a/dash-pipeline/bmv2/stages/routing_action_apply.p4 +++ b/dash-pipeline/bmv2/stages/routing_action_apply.p4 @@ -8,9 +8,13 @@ control routing_action_apply( inout metadata_t meta) { apply { - do_action_static_encap.apply(hdr, meta); do_action_nat46.apply(hdr, meta); do_action_nat64.apply(hdr, meta); + + // Encaps needs to be added after all other transforms, from inner ones to outer ones, + // because it requires the transforms on the inner packet to be finished in order to + // get the correct inner packet size and other informations. + do_action_static_encap.apply(hdr, meta); } }