Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport v3.5-branch] Keep tcp context valid for the whole connection duration #64286

Merged
merged 5 commits into from
Nov 6, 2023

Conversation

zephyrbot
Copy link
Collaborator

@zephyrbot zephyrbot commented Oct 24, 2023

Backport b510073~5..b510073 from #63984.

Fixes #63952

Increase reference count already when initial SYN is sent.
This way the tcp pointer in net_context is fully valid for
the duration of the connection.

Fixes #63952

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit fd1c226)
Return the last socket error to user.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit b864880)
If we try to connect to a port which no socket is listening to,
we will get a packet with "ACK | RST" flags set. In this case
the errno should be ECONNREFUSED instead of ETIMEDOUT like we
used to return earlier.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit ec4973d)
The writefds is typically set if there is an error while
waiting for example the connect() to finish. So check if
the user supplied the writefds and update it accordingly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 5bf18e3)
This checks that if connect() timeouts, we check TCP pointer
properly in select() and poll() in order to catch the situation.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit b510073)
@jukkar
Copy link
Member

jukkar commented Oct 24, 2023

The network tests that are failing in this PR need this one applied first #64029.

@jhedberg
Copy link
Member

jhedberg commented Nov 1, 2023

The network tests that are failing in this PR need this one applied first #64029.

That's already merged. Now this is just missing a few more approvals, especially by @rlubos (the assignee).

@jhedberg jhedberg merged commit b872bca into v3.5-branch Nov 6, 2023
24 checks passed
@nashif nashif deleted the backport-63984-to-v3.5-branch branch February 13, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking area: Sockets Networking sockets Backport Backport PR and backport failure issues
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants