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.7-branch] net: dns: Add per socket user data for the dispatcher #78281

Merged
merged 2 commits into from
Sep 23, 2024

Conversation

zephyrbot
Copy link
Collaborator

@zephyrbot zephyrbot commented Sep 11, 2024

Backport 1f627e3~2..1f627e3 from #78148.

Fixes #78146

The socket services API has a limitation where the user data is shared
between file descriptors described in the same service.

This can cause problem in DNS dispatcher where each listened socket
needs to have their own dispatcher struct set as user data so that we
can map between dispatcher context and socket. Solve this by always
have a dispatcher table as user data, and then have the actual mapping
done via the dispatcher table when receiving data to the dispatcher socket.

Fixes #78146

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit caf9fd3)
If the dispatcher is muxing the connection i.e., so there are two
services for the same port, then mark service socket descriptor
of the service with the socket number so that "net sockets" shell
command can show a proper value for it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 1f627e3)
@zephyrbot zephyrbot added Backport Backport PR and backport failure issues area: Networking labels Sep 11, 2024
@nashif nashif merged commit db20aca into v3.7-branch Sep 23, 2024
29 of 30 checks passed
@nashif nashif deleted the backport-78148-to-v3.7-branch branch September 23, 2024 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking Backport Backport PR and backport failure issues
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants