diff --git a/p4src/checksums.p4 b/p4src/checksums.p4 index bc6eb06..b913ee4 100644 --- a/p4src/checksums.p4 +++ b/p4src/checksums.p4 @@ -21,12 +21,14 @@ control MyVerifyChecksum(inout headers hdr, inout metadata meta) { control MyComputeChecksum(inout headers hdr, inout metadata meta) { apply { + bit<32> cksum = (bit<32>) hdr.ipv6.payload_length; + update_checksum ( hdr.icmp6.isValid(), { hdr.ipv6.src_addr, /* 128 */ hdr.ipv6.dst_addr, /* 128 */ - (bit<32>) hdr.ipv6.payload_length, /* 16 bit -> should be 32 according to RFC2460 - also static number? */ + cksum, /* 32 */ 24w0, /* 24 0's */ PROTO_ICMP6 /* 8 */ },