off by one for delta checksums
This commit is contained in:
parent
860db6c013
commit
0b7f0347d4
1 changed files with 11 additions and 1 deletions
|
@ -197,14 +197,24 @@ control MyIngress(inout headers hdr,
|
||||||
v4sum();
|
v4sum();
|
||||||
v6sum();
|
v6sum();
|
||||||
bit<16> diff = meta.v6sum - meta.v4sum;
|
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
|
#else
|
||||||
meta.chk_udp_v6 = 1;
|
meta.chk_udp_v6 = 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if(hdr.tcp.isValid()) {
|
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;
|
meta.chk_tcp_v6 = 1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
v6_networks.apply();
|
v6_networks.apply();
|
||||||
|
|
Loading…
Reference in a new issue