diff --git a/p4src/checksum_diff.p4 b/p4src/checksum_diff.p4 index e586d65..ab6b503 100644 --- a/p4src/checksum_diff.p4 +++ b/p4src/checksum_diff.p4 @@ -197,14 +197,24 @@ control MyIngress(inout headers hdr, v4sum(); v6sum(); bit<16> diff = meta.v6sum - meta.v4sum; - hdr.udp.checksum = hdr.udp.checksum + ~diff; + hdr.udp.checksum = hdr.udp.checksum + ~diff +1; +// hdr.udp.checksum = ~diff; #else meta.chk_udp_v6 = 1; #endif } if(hdr.tcp.isValid()) { + #ifdef USE_NICO_DELTA_CHECKSUM + v4sum(); + v6sum(); + bit<16> diff = meta.v6sum - meta.v4sum; + hdr.tcp.checksum = hdr.tcp.checksum + ~diff; + + #else + meta.chk_tcp_v6 = 1; + #endif } v6_networks.apply();