Rewrite one check to bit<1>

This commit is contained in:
Nico Schottelius 2019-03-30 17:01:04 +01:00
parent 9f5b9fb0c9
commit d1cc9d2643
3 changed files with 3 additions and 3 deletions

View File

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

View File

@ -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;

View File

@ -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){