Browse Source

Try to cast inside the checksum call

master
Nico Schottelius 4 years ago
parent
commit
60a84af033
  1. 4
      p4debug/bug2-cast-in-checksum/checksums.p4

4
p4debug/bug2-cast-in-checksum/checksums.p4

@ -21,13 +21,13 @@ control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
control MyComputeChecksum(inout headers hdr, inout metadata meta) {
apply {
meta.cast_length = (bit<32>) hdr.ipv6.payload_length;
update_checksum_with_payload(meta.do_cksum == 1,
{
hdr.ipv6.src_addr, /* 128 */
hdr.ipv6.dst_addr, /* 128 */
meta.cast_length, /* 32 */
meta.cast_length = (bit<32>) hdr.ipv6.payload_length;
24w0, /* 24 0's */
PROTO_ICMP6 /* 8 */
},

Loading…
Cancel
Save