Try implicit cast by prepending 16 0 bits

This commit is contained in:
Nico Schottelius 2019-03-06 13:23:41 +01:00
parent 25f80b1b76
commit b0f3f5ea85
2 changed files with 3 additions and 2 deletions

View file

@ -25,7 +25,8 @@ control MyComputeChecksum(inout headers hdr, inout metadata meta) {
{ {
hdr.ipv6.src_addr, /* 128 */ hdr.ipv6.src_addr, /* 128 */
hdr.ipv6.dst_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 */ 24w0, /* 24 0's */
PROTO_ICMP6 /* 8 */ PROTO_ICMP6 /* 8 */
}, },

View file

@ -63,7 +63,7 @@ control MyIngress(inout headers hdr,
hdr.icmp6.type = ICMP6_ECHO_REPLY; hdr.icmp6.type = ICMP6_ECHO_REPLY;
meta.calc_icmp6_checksum = true; 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 ***********************************/ /********************** Reply to NDP for US ***********************************/