From b0f3f5ea85b430ced817451f3ba9bf1189d617b3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Mar 2019 13:23:41 +0100 Subject: [PATCH] Try implicit cast by prepending 16 0 bits --- p4src/checksums.p4 | 3 ++- p4src/static-mapping.p4 | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/p4src/checksums.p4 b/p4src/checksums.p4 index 3af0f81..d456ab5 100644 --- a/p4src/checksums.p4 +++ b/p4src/checksums.p4 @@ -25,7 +25,8 @@ control MyComputeChecksum(inout headers hdr, inout metadata meta) { { hdr.ipv6.src_addr, /* 128 */ hdr.ipv6.dst_addr, /* 128 */ - meta.cast_length, /* 32 */ + 16w0, /* 16 try implicit cast */ + hdr.ipv6.payload_length, /* 16 */ 24w0, /* 24 0's */ PROTO_ICMP6 /* 8 */ }, diff --git a/p4src/static-mapping.p4 b/p4src/static-mapping.p4 index 36c67c5..af06ad6 100644 --- a/p4src/static-mapping.p4 +++ b/p4src/static-mapping.p4 @@ -63,7 +63,7 @@ control MyIngress(inout headers hdr, hdr.icmp6.type = ICMP6_ECHO_REPLY; meta.calc_icmp6_checksum = true; - meta.cast_length = (bit<32>) hdr.ipv6.payload_length; + //meta.cast_length = (bit<32>) hdr.ipv6.payload_length; } /********************** Reply to NDP for US ***********************************/