[p4] try casting before

This commit is contained in:
Nico Schottelius 2019-02-28 11:06:11 +01:00
parent 21d1b82416
commit 1f497982b3
1 changed files with 3 additions and 1 deletions

View File

@ -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 */
},