Skip to content

Conversation

@zeldin
Copy link

@zeldin zeldin commented Aug 1, 2025

I fixed two issues with the TCP handling.

The first is that it got confused about the payload length when there are options in the received TCP packet.

The other is that it kept retransmitting packets even after all data had been acked by the peer, eventually closing down
the socket because the retry count never got reset.

zeldin added 4 commits August 1, 2025 15:38
The variable _sckt->timeout is used for the sole purpose of
determining whether the sequence number should be incremented, or
whether this is a retransmit.  However, the updating of this variable
didn't really work correctly since nwk_upstream can be called through
other means than from nwk_tick (there is for example a "Reschedule
50ms later for eventual further processing") which is where the
variable would be updated.  The result being that the sequence number
would be incorrectly incremented on any retransmit caused by a call to
nwk_upstream not coming from nwk_tick.

Change this to the more robust approach of setting timeout whenever
the sequence number is incremented, and clearing it only when there
is new data to transmit.

This variable could probably use a new name as well.  :-)
If the callback responded to the disconnect event by doing socket_release,
then then handshake would never complete.  Therefore, hold off on the
event until after the handshake has completed.
@zeldin
Copy link
Author

zeldin commented Aug 1, 2025

Added two more. The first fixes weeip getting confused about the sequence number when transmitting. The second is just removing of a "TESTE" event generator which made it difficult to properly clean up a socket when it is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant