From dfc47501e197c53619e26ebb915a4e7954a129b2 Mon Sep 17 00:00:00 2001 From: r12f Date: Tue, 27 Feb 2024 05:20:05 +0000 Subject: [PATCH] Fix the order of applying the routing actions. --- dash-pipeline/bmv2/stages/routing_action_apply.p4 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); } }