From 7bba816f2c58ceed449903dd2ea1cfc26c065949 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 25 Jul 2019 14:40:20 +0200 Subject: [PATCH] v4 if next to v6 if, not to nat64 --- doc/plan.org | 19 ++++++++++++++++ p4src/minip4_solution.p4 | 48 ++++++++++++++++++++-------------------- 2 files changed, 43 insertions(+), 24 deletions(-) diff --git a/doc/plan.org b/doc/plan.org index 7f29b40..9b9abe0 100644 --- a/doc/plan.org +++ b/doc/plan.org @@ -6787,6 +6787,25 @@ action delta_udp_from_v6_to_v4() #+END_CENTER +*** TODO 2019-07-25: BUG overwrite +#+BEGIN_CENTER +make -C src/ +make[1]: Entering directory '/home/nico/projects/P4-NetFPGA/contrib-projects/sume-sdnet-switch/projects/minip4/src' +p4c-sdnet -o minip4.sdnet --sdnet_info .sdnet_switch_info.dat minip4_solution.p4 +minip4_solution.p4(19): [--Wwarn=uninitialized_out_param] warning: out parameter meta may be uninitialized when RealParser terminates + out metadata meta, + ^^^^ +minip4_solution.p4(16) +parser RealParser( + ^^^^^^^^^^ +terminate called after throwing an instance of 'Util::CompilerBug' + what(): In file: /wrk/hdscratch/staff/mohan/p4c_sdnet/build/p4c/extensions/sdnet/translate/core/tupleEngine.cpp:324 +Compiler Bug: overwrite + +Makefile:34: recipe for target 'all' failed + +#+END_CENTER + ** The NetPFGA saga Problems encountered: - The logfile for a compile run is 10k+ lines diff --git a/p4src/minip4_solution.p4 b/p4src/minip4_solution.p4 index 1511387..938fc43 100644 --- a/p4src/minip4_solution.p4 +++ b/p4src/minip4_solution.p4 @@ -130,35 +130,35 @@ control RealMain( v4_networks.apply(); /* apply egress for IPv4 */ exit; /* no further v6 processing */ - - } else if(hdr.ipv4.isValid()) { - if(nat46.apply().hit) { - if(hdr.icmp.isValid()) { - nat46_icmp_generic(); - - if(hdr.icmp.type == ICMP_ECHO_REPLY) { - hdr.icmp6.type = ICMP6_ECHO_REPLY; - } - if(hdr.icmp.type == ICMP_ECHO_REQUEST) { - hdr.icmp6.type = ICMP6_ECHO_REQUEST; - } - } - if(hdr.udp.isValid()) { - delta_udp_from_v4_to_v6 - } - if(hdr.tcp.isValid()) { - delta_tcp_from_v4_to_v6 - } - - v6_networks.apply(); - exit; - } - v4_networks.apply(); /* regular routing, egress */ } + } else if(hdr.ipv4.isValid()) { + if(nat46.apply().hit) { + if(hdr.icmp.isValid()) { + nat46_icmp_generic(); + + if(hdr.icmp.type == ICMP_ECHO_REPLY) { + hdr.icmp6.type = ICMP6_ECHO_REPLY; + } + if(hdr.icmp.type == ICMP_ECHO_REQUEST) { + hdr.icmp6.type = ICMP6_ECHO_REQUEST; + } + } + if(hdr.udp.isValid()) { + delta_udp_from_v4_to_v6 + } + if(hdr.tcp.isValid()) { + delta_tcp_from_v4_to_v6 + } + + v6_networks.apply(); + exit; + } + v4_networks.apply(); /* regular routing, egress */ } lookup_table.apply(); } + } control TopPipe(