Skip to content

Commit d58e1ea

Browse files
jukkardkalowsk
authored andcommitted
net: dns: Close socket service properly from dispatcher
We need to close the socket service context when dispatcher is unregistered. Fixes #82652 Signed-off-by: Jukka Rissanen <[email protected]> (cherry picked from commit da148ab)
1 parent fc639b6 commit d58e1ea

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

subsys/net/lib/dns/dispatcher.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,11 @@ int dns_dispatcher_unregister(struct dns_socket_dispatcher *ctx)
334334

335335
(void)sys_slist_find_and_remove(&sockets, &ctx->node);
336336

337+
(void)net_socket_service_unregister(ctx->svc);
338+
339+
/* Mark the context as unregistered */
340+
ctx->sock = -1;
341+
337342
for (int i = 0; i < ctx->fds_len; i++) {
338343
CHECKIF((int)ctx->fds[i].fd >= (int)ARRAY_SIZE(dispatch_table)) {
339344
ret = -ERANGE;

0 commit comments

Comments
 (0)