From 71d1e86d3fe9f730eb1be0dba1899fa29c8122db Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 3 Apr 2019 12:44:00 +0200 Subject: [PATCH] Setup the cast_length in icmp->icmp6 translations --- doc/plan.org | 1 + p4src/static-mapping.p4 | 3 +++ 2 files changed, 4 insertions(+) diff --git a/doc/plan.org b/doc/plan.org index 2b40b7a..8973091 100644 --- a/doc/plan.org +++ b/doc/plan.org @@ -738,6 +738,7 @@ Entry has been added with handle 0 ******* DONE Make switch respond to ARP ******* DONE Make switch respond to icmp echo request w/ correct checksum (2019-04-03) ******* TODO Correct icmp6 checksum +******** DONE Checksum is SET, but not correct! **** TODO Add / check default route for v4 hosts **** TODO Update p4c to avoid compiler bug ***** TODO Updating p4c diff --git a/p4src/static-mapping.p4 b/p4src/static-mapping.p4 index 2a476c4..7a4a0dd 100644 --- a/p4src/static-mapping.p4 +++ b/p4src/static-mapping.p4 @@ -167,6 +167,7 @@ Echo or Echo Reply Message hdr.ipv6.next_header = PROTO_ICMP6; meta.chk_icmp6 = 1; + meta.cast_length = (bit<32>) hdr.ipv6.payload_length; hdr.icmp.setInvalid(); } @@ -437,9 +438,11 @@ Echo or Echo Reply Message if(hdr.icmp6.type == ICMP6_ECHO_REPLY) { hdr.icmp.type = ICMP_ECHO_REPLY; + hdr.icmp.code = 0; } if(hdr.icmp6.type == ICMP6_ECHO_REQUEST) { hdr.icmp.type = ICMP_ECHO_REQUEST; + hdr.icmp.code = 0; } }