[p4] try casting before
This commit is contained in:
parent
21d1b82416
commit
1f497982b3
1 changed files with 3 additions and 1 deletions
|
@ -21,12 +21,14 @@ control MyVerifyChecksum(inout headers hdr, inout metadata meta) {
|
||||||
|
|
||||||
control MyComputeChecksum(inout headers hdr, inout metadata meta) {
|
control MyComputeChecksum(inout headers hdr, inout metadata meta) {
|
||||||
apply {
|
apply {
|
||||||
|
bit<32> cksum = (bit<32>) hdr.ipv6.payload_length;
|
||||||
|
|
||||||
update_checksum (
|
update_checksum (
|
||||||
hdr.icmp6.isValid(),
|
hdr.icmp6.isValid(),
|
||||||
{
|
{
|
||||||
hdr.ipv6.src_addr, /* 128 */
|
hdr.ipv6.src_addr, /* 128 */
|
||||||
hdr.ipv6.dst_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 */
|
24w0, /* 24 0's */
|
||||||
PROTO_ICMP6 /* 8 */
|
PROTO_ICMP6 /* 8 */
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue