Browse Source

off by one for delta checksums

master
Nico Schottelius 3 years ago
parent
commit
0b7f0347d4
  1. 12
      p4src/checksum_diff.p4

12
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();

Loading…
Cancel
Save