From 7be9c01b48ea12c02ebef5e61f57c518cba53217 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 6 May 2019 12:50:45 +0200 Subject: [PATCH] stop processing v6 when matching for nat64 session --- doc/plan.org | 13 +++++++++++++ p4src/nat64.p4 | 16 ++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/doc/plan.org b/doc/plan.org index f67e3e2..f8c4943 100644 --- a/doc/plan.org +++ b/doc/plan.org @@ -1873,6 +1873,19 @@ libnanomsg-dev libjudy-dev ***** DONE Create ipv6 session in the controller ***** Create ipv4 session in the controller ***** TODO Ensure translation code works +>>> ipaddress.IPv6Network("2001:db8:100::/96")[int(ipaddress.IPv4Address("10.0.0.1"))] +IPv6Address('2001:db8:100::a00:1') + +****** DONE Status: syn sent, neighbor solicitation working, nothing received on other side + +INFO:main:unhandled reassambled=>>> from table TABLE_NAT64_SESSION +INFO:main:unhandled reassambled=>> from table TABLE_V6_NETWORKS +INFO:main:unhandled reassambled=>> from table TABLE_V6_NETWORKS +INFO:main:unhandled reassambled=>> from table TABLE_V6_NETWORKS + +****** DONE action nat64_tcp_session_create is called + + **** TODO tcp session **** TODO udp session **** TODO tcp session diff --git a/p4src/nat64.p4 b/p4src/nat64.p4 index a463d83..2e86d08 100644 --- a/p4src/nat64.p4 +++ b/p4src/nat64.p4 @@ -499,6 +499,7 @@ Echo or Echo Reply Message NoAction; } size = ROUTING_TABLE_SIZE; + default_action = controller_debug_table_id(TABLE_V6_NETWORKS); } @@ -522,6 +523,11 @@ Echo or Echo Reply Message if(hdr.ipv6.isValid()) { /* We hit an entry in the dynamic IPv6 range */ if(nat64_session.apply().hit) { + if(hdr.tcp.isValid()) { + if(nat64_tcp_session.apply().hit) { + meta.chk_tcp_v4 = 1; + } + } // if(hdr.icmp6.isValid()) { // /* If this is not a hit => will escalate to controller // * If this is a hit, it has a mapping */ @@ -530,12 +536,10 @@ Echo or Echo Reply Message // if(hdr.udp.isValid()) { // nat64_udp_session.apply(); // meta.chk_udp_v4 = 1; - // } - if(hdr.tcp.isValid()) { - if(nat64_tcp_session.apply().hit) { - meta.chk_tcp_v4 = 1; - } - } + // } + + + exit; /* no further v6 processing */ } if(nat64.apply().hit) { /* generic / static nat64 done */