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

net: context: set default offloaded iface during net_context_get() #59851

Conversation

mniestroj
Copy link
Member

Set default offloaded interface during net_context_get() call, so that
net_context_recv() can be called before net_context_connect(). There is
already an assumption about using default network interface, so this should
not be harmful.

Fixes: 2c75070 ("net: sockets: tcp: Fix possible race between
connect/recv")
Fixes: #59850

Set default offloaded interface during net_context_get() call, so that
net_context_recv() can be called before net_context_connect(). There is
already an assumption about using default network interface, so this should
not be harmful.

Fixes: 2c75070 ("net: sockets: tcp: Fix possible race between
  connect/recv")
Signed-off-by: Marcin Niestroj <[email protected]>
Copy link
Contributor

@rlubos rlubos left a comment

Choose a reason for hiding this comment

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

LGTM

@rlubos rlubos requested a review from jukkar June 29, 2023 14:52
@mniestroj mniestroj added the backport v3.4-branch Backport to the v3.4-branch label Jun 29, 2023
@carlescufi carlescufi merged commit 40d2240 into zephyrproject-rtos:main Jun 29, 2023
21 checks passed
@mniestroj mniestroj deleted the net-offloaded-iface-set-during-context-get branch June 30, 2023 04:03
@JordanYates
Copy link
Collaborator

Also pointing out this fixes assertions/crashes when attempting to close a socket immediately after creating it (due to a failed connect call).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking backport v3.4-branch Backport to the v3.4-branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

net: offload: connect() on UDP socket with offloaded IP results in crash
6 participants