Get rid of negative wrap around

This commit is contained in:
Nico Schottelius 2019-07-16 13:05:13 +02:00
commit bc90421426
2 changed files with 30 additions and 5 deletions

View file

@ -5335,8 +5335,20 @@ Gives off-by-one in udp, sometimes!
10:08:52.626713 IP6 (hlim 64, next-header UDP (17) payload length: 14) 2001:db8:1::a00:1.51345 > 2001:db8::1.2342: [bad udp cks
*** TODO 2019-07-16: get values: v6sum, v4sum
*** TODO 2019-07-16: get values from P4: v6sum, v4sum and co.
- v6sum = 0x9a6b
- v4sum = 0xeadd
- 0x4a8a + 0x9a6b = 0xe4f5 (same as python)
(code: hdr.udp.checksum = 0x4a8a + 0x9a6b)
- hdr.udp.checksum = 0x4a8a + 0x9a6b - 0xeadd;
../p4src/actions_delta_checksum.p4(58): warning: -1512: negative
value with unsigned type
hdr.udp.checksum = 0x4a8a + 0x9a6b - 0xeadd;
Result: 0xfa18!
** The NetPFGA saga
Problems encountered: