When the TCP sequence number subtracted is greater than 2**32 minus the limit, or 2**31 minus the limit, the use of unsigned long as an intermediate variable, may result in an incorrect retransmit length computation on all 64-bit platforms in the TCP stack. While at it create a helper macro to facilitate the computation of the difference between TCP sequence numbers. MFC after: 3 days Sponsored by: NVIDIA Networking
Details
Details
- Reviewers
bz tuexen rscheff • hselasky - Group Reviewers
network transport - Commits
- rGbc92b6240ddf: tcp: Correctly compute the retransmit length for all 64-bit platforms.
rG7169d3610d1c: tcp: Correctly compute the retransmit length for all 64-bit platforms.
rG95a99019968c: tcp: Correctly compute the retransmit length for all 64-bit platforms.
rG28173d49dccb: tcp: Correctly compute the retransmit length for all 64-bit platforms.
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
How to reproduce:
cc -DSIMULATE_32BIT_LONG test7.c && ./a.out > a.txt cc test7.c && ./a.out > b.txt diff -u a.txt b.txt
Comment Actions
There may be other places where tcp seq numbers are calculated using simple substraction...
Comment Actions
I'll have a look. Could you check the sequence number in the dump's you've got, if they match this criteria?
Comment Actions
I did a grep for unsigned long and u_long and this was the only place I could see was affected.