Skip to content

Conversation

@jukkar
Copy link
Member

@jukkar jukkar commented Sep 9, 2024

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

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 zephyrproject-rtos#78146

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
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>
@jukkar jukkar added the backport v3.7-branch Request backport to the v3.7-branch label Sep 9, 2024
@nashif nashif merged commit 1f627e3 into zephyrproject-rtos:main Sep 11, 2024
@jukkar jukkar deleted the fix/dns-dispatcher branch September 11, 2024 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Networking backport v3.7-branch Request backport to the v3.7-branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v3.7] mDNS reponder might fail to serve if mDNS resolver is enabled

5 participants