From cd3084d8f9d2b907dcaf465fb107a7dae00d38a2 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 30 Mar 2019 17:19:17 +0100 Subject: [PATCH] rewrite checksum triggers in ndp/echo reply --- doc/plan.org | 2 ++ p4src/static-mapping.p4 | 20 ++++++-------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/doc/plan.org b/doc/plan.org index a672266..8dad942 100644 --- a/doc/plan.org +++ b/doc/plan.org @@ -524,6 +524,8 @@ p4@ubuntu:~/master-thesis/pcap$ -> NDP is going to the controller instead of being handled by the switch INFO:main:unhandled reassambled=>>> from table TABLE_V6_NETWORKS +-> checksums likely broken again due to checksum changes + **** DONE Add table name support in debug messages **** DONE Why getting IPv6 packets in INFO:main:unhandled reassambled=>>> from table TABLE_V6_NETWORKS diff --git a/p4src/static-mapping.p4 b/p4src/static-mapping.p4 index a28e47c..18eec35 100644 --- a/p4src/static-mapping.p4 +++ b/p4src/static-mapping.p4 @@ -264,17 +264,8 @@ Echo or Echo Reply Message hdr.icmp6_option_link_layer_addr.ll_length = 1; /* 1* 64 bit */ hdr.icmp6_option_link_layer_addr.mac_addr = mac_addr; - /* version1: rebuilding packet */ - /* - truncate((bit<32>)(112 + 320 + 32)/8); - hdr.icmp6_na.setValid(); - - hdr.icmp6_na.solicitated = 1; - hdr.icmp6_na.override = 1; - */ - - /* checksum trigger / content */ - meta.switch_task = TASK_CHECKSUM_ICMP6_NA; + /* 5. Checksum trigger/info */ + meta.chk_icmp6_na_ns = 1; meta.cast_length = (bit<32>) hdr.ipv6.payload_length; } @@ -289,7 +280,8 @@ Echo or Echo Reply Message hdr.icmp6.type = ICMP6_ECHO_REPLY; - meta.switch_task = TASK_CHECKSUM_ICMP6; + meta.chk_icmp6 = 1; + meta.cast_length = (bit<32>) hdr.ipv6.payload_length; } @@ -373,8 +365,6 @@ Echo or Echo Reply Message /********************** APPLYING TABLES ***********************************/ apply { if(hdr.ipv6.isValid()) { - icmp6.apply(); /* icmp6 echo, icmp6 ndp */ - if(nat64.apply().hit) { /* generic nat64 done */ if(hdr.icmp6.isValid()) { nat64_icmp6_generic(); @@ -391,6 +381,8 @@ Echo or Echo Reply Message exit; /* no further v6 processing */ } + icmp6.apply(); /* icmp6 echo, icmp6 ndp */ + v6_networks.apply(); /* regular egress / routing */ } else if(hdr.ipv4.isValid()) { if(nat46.apply().hit) {