diff --git a/p4src/minip4_solution.p4 b/p4src/minip4_solution.p4 index 0ce29d9..34693b6 100644 --- a/p4src/minip4_solution.p4 +++ b/p4src/minip4_solution.p4 @@ -56,7 +56,7 @@ parser TopParser(packet_in packet, inout sume_metadata_t standard_metadata) { #include "parsers.p4" - digest_data.unused = 0; /* avoid compiler warning */ + } diff --git a/p4src/parsers.p4 b/p4src/parsers.p4 index 25bada6..5c61b9a 100644 --- a/p4src/parsers.p4 +++ b/p4src/parsers.p4 @@ -17,6 +17,10 @@ meta.v6sum = 0; meta.headerdiff = 0; + #ifdef _SUME_SWITCH_P4_ + digest_data.unused = 0; /* avoid compiler warning */ + #endif + packet.extract(hdr.ethernet); transition select(hdr.ethernet.ethertype){ TYPE_IPV4: ipv4;