From d1cc9d264385415fb6393d3ac23e941324ddb54e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 30 Mar 2019 17:01:04 +0100 Subject: [PATCH] Rewrite one check to bit<1> --- p4src/checksums.p4 | 2 +- p4src/headers.p4 | 2 +- p4src/parsers.p4 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/p4src/checksums.p4 b/p4src/checksums.p4 index d6bcb60..af4e4cc 100644 --- a/p4src/checksums.p4 +++ b/p4src/checksums.p4 @@ -37,7 +37,7 @@ control MyComputeChecksum(inout headers hdr, inout metadata meta) { ); /* checksumming for icmp6_na_ns_option */ - update_checksum_with_payload(meta.chk_icmp6_na_ns == true, + update_checksum_with_payload(meta.chk_icmp6_na_ns == 1, { hdr.ipv6.src_addr, /* 128 */ hdr.ipv6.dst_addr, /* 128 */ diff --git a/p4src/headers.p4 b/p4src/headers.p4 index 4dc7480..12132c2 100644 --- a/p4src/headers.p4 +++ b/p4src/headers.p4 @@ -181,7 +181,7 @@ struct metadata { task_t switch_task; /* migrate tasks to bool */ - bool chk_icmp6_na_ns; + bit<1> chk_icmp6_na_ns; bool chk_icmp6; bool chk_icmp; diff --git a/p4src/parsers.p4 b/p4src/parsers.p4 index 01dec7a..a21a986 100644 --- a/p4src/parsers.p4 +++ b/p4src/parsers.p4 @@ -16,7 +16,7 @@ parser MyParser(packet_in packet, meta.chk_icmp = false; meta.chk_icmp6 = false; - meta.chk_icmp6_na_ns = false; + meta.chk_icmp6_na_ns = 0; packet.extract(hdr.ethernet); transition select(hdr.ethernet.ethertype){