Skip to content

Fix initialization of SND_UNA to ISN#51

Merged
gasbytes merged 1 commit intowolfSSL:masterfrom
danielinux:isn-in-snd-una
Mar 2, 2026
Merged

Fix initialization of SND_UNA to ISN#51
gasbytes merged 1 commit intowolfSSL:masterfrom
danielinux:isn-in-snd-una

Conversation

@danielinux
Copy link
Copy Markdown
Member

  • related test
    wolfIP_sock_accept() was failing to set snd_una to the ISN

Fenrir/239

Copilot AI review requested due to automatic review settings March 2, 2026 13:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes TCP sender state initialization when accepting incoming connections so snd_una correctly starts at the connection’s ISN (preventing invalid sequence ordering), and adds a regression unit test.

Changes:

  • Initialize newts->sock.tcp.snd_una to the initial sequence number during wolfIP_sock_accept().
  • Add a unit test that validates snd_una starts at ISN and remains <= seq after SYN-ACK advances seq.
  • Register the new test in the unit test suite.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/wolfip.c Initializes snd_una on the accepted TCP socket to ensure correct ISN-based sender state.
src/test/unit/unit.c Adds and registers a regression test covering snd_una initialization during accept().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/test/unit/unit.c
Copy link
Copy Markdown
Contributor

@gasbytes gasbytes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, confirmed fix locally via gh cli.

@gasbytes gasbytes merged commit 254bc9c into wolfSSL:master Mar 2, 2026
19 checks passed
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.

3 participants