smoltcp icon indicating copy to clipboard operation
smoltcp copied to clipboard

TCP sequence number uses signed integers

Open pchaseh opened this issue 7 months ago • 1 comments
trafficstars

While working with this library, I have noticed that in commit https://github.com/smoltcp-rs/smoltcp/commit/e13e40668a5229a827efeef78983546d6a386fab the sequence numbers for TCP are reworked to use signed 32-bit integers. This seems rather unusual to me, given that every resource I can find describes this field as being in the range of 0 to 2^32 - 1. I am hoping that someone can provide clarification on why this decision was chosen

pchaseh avatar Apr 08 '25 20:04 pchaseh

In the end sequence numbers are integers modulo 2^32 where the only thing that matter is the position of one relative to another, not the absolute value.. The behavior is the same whether they're signed or unsigned. Have you found any actual misbehavior due to this?

Dirbaio avatar Apr 08 '25 20:04 Dirbaio