Lines Matching +full:multicast +full:- +full:hash

11  * SPDX-License-Identifier: Apache-2.0
55 * See https://tools.ietf.org/html/rfc1035#section-4.1.4
60 * https://tools.ietf.org/html/rfc1035#section-4.1.2
108 if (net_ipv4_is_addr_mcast(&net_sin(addr)->sin_addr) && in server_is_mdns()
109 net_sin(addr)->sin_addr.s4_addr[3] == 251U) { in server_is_mdns()
117 if (net_ipv6_is_addr_mcast(&net_sin6(addr)->sin6_addr) && in server_is_mdns()
118 net_sin6(addr)->sin6_addr.s6_addr[15] == 0xfb) { in server_is_mdns()
131 if (net_ipv4_is_addr_mcast(&net_sin(addr)->sin_addr) && in server_is_llmnr()
132 net_sin(addr)->sin_addr.s4_addr[3] == 252U) { in server_is_llmnr()
140 if (net_ipv6_is_addr_mcast(&net_sin6(addr)->sin6_addr) && in server_is_llmnr()
141 net_sin6(addr)->sin6_addr.s6_addr[15] == 0x03) { in server_is_llmnr()
153 struct sockaddr *addr = &ctx->servers[idx].dns_server; in dns_postprocess_server()
155 if (addr->sa_family == AF_INET) { in dns_postprocess_server()
156 ctx->servers[idx].is_mdns = server_is_mdns(AF_INET, addr); in dns_postprocess_server()
157 if (!ctx->servers[idx].is_mdns) { in dns_postprocess_server()
158 ctx->servers[idx].is_llmnr = in dns_postprocess_server()
162 if (net_sin(addr)->sin_port == 0U) { in dns_postprocess_server()
164 ctx->servers[idx].is_mdns) { in dns_postprocess_server()
170 net_sin(addr)->sin_port = htons(5353); in dns_postprocess_server()
172 ctx->servers[idx].is_llmnr) { in dns_postprocess_server()
178 net_sin(addr)->sin_port = htons(5355); in dns_postprocess_server()
180 net_sin(addr)->sin_port = htons(53); in dns_postprocess_server()
184 ctx->servers[idx].is_mdns = server_is_mdns(AF_INET6, addr); in dns_postprocess_server()
185 if (!ctx->servers[idx].is_mdns) { in dns_postprocess_server()
186 ctx->servers[idx].is_llmnr = in dns_postprocess_server()
190 if (net_sin6(addr)->sin6_port == 0U) { in dns_postprocess_server()
192 ctx->servers[idx].is_mdns) { in dns_postprocess_server()
193 net_sin6(addr)->sin6_port = htons(5353); in dns_postprocess_server()
195 ctx->servers[idx].is_llmnr) { in dns_postprocess_server()
196 net_sin6(addr)->sin6_port = htons(5355); in dns_postprocess_server()
198 net_sin6(addr)->sin6_port = htons(53); in dns_postprocess_server()
214 k_mutex_lock(&ctx->lock, K_FOREVER); in dispatcher_cb()
216 if (ctx->state != DNS_RESOLVE_CONTEXT_ACTIVE) { in dispatcher_cb()
220 dns_cname = net_buf_alloc(&dns_qname_pool, ctx->buf_timeout); in dispatcher_cb()
245 if (ctx->servers[j].sock < 0) { in dispatcher_cb()
249 ret = dns_write(ctx, j, i, dns_data->data, len, in dispatcher_cb()
275 invoke_query_callback(ret, NULL, &ctx->queries[i]); in dispatcher_cb()
278 release_query(&ctx->queries[i]); in dispatcher_cb()
286 k_mutex_unlock(&ctx->lock); in dispatcher_cb()
298 server->dispatcher.type = DNS_SOCKET_RESOLVER; in register_dispatcher()
299 server->dispatcher.cb = dispatcher_cb; in register_dispatcher()
300 server->dispatcher.fds = ctx->fds; in register_dispatcher()
301 server->dispatcher.fds_len = ARRAY_SIZE(ctx->fds); in register_dispatcher()
302 server->dispatcher.sock = server->sock; in register_dispatcher()
303 server->dispatcher.svc = svc; in register_dispatcher()
304 server->dispatcher.resolve_ctx = ctx; in register_dispatcher()
307 server->dns_server.sa_family == AF_INET6) { in register_dispatcher()
308 memcpy(&server->dispatcher.local_addr, in register_dispatcher()
312 server->dns_server.sa_family == AF_INET) { in register_dispatcher()
313 memcpy(&server->dispatcher.local_addr, in register_dispatcher()
317 return -ENOTSUP; in register_dispatcher()
320 return dns_dispatcher_register(&server->dispatcher); in register_dispatcher()
338 ret = -errno; in bind_to_iface()
341 net_sprint_addr(addr->sa_family, &net_sin(addr)->sin_addr), in bind_to_iface()
374 return -ENOENT; in dns_resolve_init_locked()
377 if (ctx->state != DNS_RESOLVE_CONTEXT_INACTIVE) { in dns_resolve_init_locked()
378 ret = -ENOTEMPTY; in dns_resolve_init_locked()
382 ARRAY_FOR_EACH(ctx->servers, j) { in dns_resolve_init_locked()
383 ctx->servers[j].sock = -1; in dns_resolve_init_locked()
386 ARRAY_FOR_EACH(ctx->fds, j) { in dns_resolve_init_locked()
387 ctx->fds[j].fd = -1; in dns_resolve_init_locked()
395 struct sockaddr *addr = &ctx->servers[idx].dns_server; in dns_resolve_init_locked()
399 server_len = iface_str - servers[i]; in dns_resolve_init_locked()
409 ctx->servers[idx].if_index = 0; in dns_resolve_init_locked()
412 ctx->servers[idx].if_index = in dns_resolve_init_locked()
418 ctx->servers[idx].if_index = 0; in dns_resolve_init_locked()
437 (ctx->servers[i].is_mdns ? " mDNS" : "") : "", in dns_resolve_init_locked()
439 (ctx->servers[i].is_llmnr ? " LLMNR" : "") : "", in dns_resolve_init_locked()
448 memcpy(&ctx->servers[idx].dns_server, servers_sa[i], in dns_resolve_init_locked()
449 sizeof(ctx->servers[idx].dns_server)); in dns_resolve_init_locked()
456 i < SERVER_COUNT && ctx->servers[i].dns_server.sa_family; i++) { in dns_resolve_init_locked()
458 if (ctx->servers[i].dns_server.sa_family == AF_INET6) { in dns_resolve_init_locked()
464 ctx->servers[i].is_mdns) { in dns_resolve_init_locked()
472 if (ctx->servers[i].dns_server.sa_family == AF_INET) { in dns_resolve_init_locked()
478 ctx->servers[i].is_mdns) { in dns_resolve_init_locked()
488 ret = -EAFNOSUPPORT; in dns_resolve_init_locked()
492 ret = zsock_socket(ctx->servers[i].dns_server.sa_family, in dns_resolve_init_locked()
495 ret = -errno; in dns_resolve_init_locked()
500 ctx->servers[i].sock = ret; in dns_resolve_init_locked()
503 if (ctx->servers[i].if_index > 0) { in dns_resolve_init_locked()
504 ret = bind_to_iface(ctx->servers[i].sock, in dns_resolve_init_locked()
505 &ctx->servers[i].dns_server, in dns_resolve_init_locked()
506 ctx->servers[i].if_index); in dns_resolve_init_locked()
508 zsock_close(ctx->servers[i].sock); in dns_resolve_init_locked()
509 ctx->servers[i].sock = -1; in dns_resolve_init_locked()
513 iface = net_if_get_by_index(ctx->servers[i].if_index); in dns_resolve_init_locked()
515 net_sprint_addr(ctx->servers[i].dns_server.sa_family, in dns_resolve_init_locked()
516 &net_sin(&ctx->servers[i].dns_server)->sin_addr), in dns_resolve_init_locked()
517 ctx->servers[i].if_index); in dns_resolve_init_locked()
522 if (ctx->servers[i].dns_server.sa_family == AF_INET6) { in dns_resolve_init_locked()
525 &net_sin6(&ctx->servers[i].dns_server)->sin6_addr); in dns_resolve_init_locked()
529 &net_sin6(&ctx->servers[i].dns_server)->sin6_addr); in dns_resolve_init_locked()
533 &net_sin(&ctx->servers[i].dns_server)->sin_addr); in dns_resolve_init_locked()
537 &net_sin(&ctx->servers[i].dns_server)->sin_addr); in dns_resolve_init_locked()
540 ARRAY_FOR_EACH(ctx->fds, j) { in dns_resolve_init_locked()
541 if (ctx->fds[j].fd == ctx->servers[i].sock) { in dns_resolve_init_locked()
547 if (ctx->fds[j].fd < 0) { in dns_resolve_init_locked()
548 ctx->fds[j].fd = ctx->servers[i].sock; in dns_resolve_init_locked()
549 ctx->fds[j].events = ZSOCK_POLLIN; in dns_resolve_init_locked()
557 zsock_close(ctx->servers[i].sock); in dns_resolve_init_locked()
561 ret = register_dispatcher(ctx, &resolve_svc, &ctx->servers[i], local_addr, in dns_resolve_init_locked()
564 if (ret == -EALREADY) { in dns_resolve_init_locked()
569 ctx->servers[i].is_mdns ? "mDNS" : "DNS", ret); in dns_resolve_init_locked()
576 iface, (void *)&ctx->servers[i].dns_server, in dns_resolve_init_locked()
598 ret = -EINVAL; in dns_resolve_init_locked()
603 ctx->state = DNS_RESOLVE_CONTEXT_ACTIVE; in dns_resolve_init_locked()
604 ctx->buf_timeout = DNS_BUF_TIMEOUT; in dns_resolve_init_locked()
615 return -ENOENT; in dns_resolve_init()
620 (void)k_mutex_init(&ctx->lock); in dns_resolve_init()
621 ctx->state = DNS_RESOLVE_CONTEXT_INACTIVE; in dns_resolve_init()
645 if (pending_query->cb != NULL) { in check_query_active()
648 && pending_query->query == NULL in check_query_active()
649 && k_work_delayable_busy_get(&pending_query->timer) == 0) { in check_query_active()
650 pending_query->cb = NULL; in check_query_active()
664 if (!check_query_active(&ctx->queries[i], true)) { in get_cb_slot()
669 return -ENOENT; in get_cb_slot()
687 if (pending_query->query != NULL && pending_query->cb != NULL) { in invoke_query_callback()
688 pending_query->cb(status, info, pending_query->user_data); in invoke_query_callback()
700 int busy = k_work_cancel_delayable(&pending_query->timer); in release_query()
705 pending_query->cb = NULL; in release_query()
711 pending_query->query = NULL; in release_query()
723 if (check_query_active(&ctx->queries[i], false) && in get_slot_by_id()
724 ctx->queries[i].id == dns_id && in get_slot_by_id()
726 ctx->queries[i].query_hash == query_hash)) { in get_slot_by_id()
731 return -ENOENT; in get_slot_by_id()
757 if (dns_msg->msg_size < (sizeof(*dns_id) + sizeof(uint16_t))) { in dns_validate_msg()
768 *dns_id = dns_unpack_header_id(dns_msg->msg); in dns_validate_msg()
770 if (dns_header_rcode(dns_msg->msg) == DNS_HEADER_REFUSED) { in dns_validate_msg()
778 if (dns_header_qr(dns_msg->msg) == DNS_QUERY) { in dns_validate_msg()
789 if (dns_header_qdcount(dns_msg->msg) != 1) { in dns_validate_msg()
799 if (ret == -ENOMEM) { in dns_validate_msg()
813 dns_msg->answer_offset = dns_msg->query_offset; in dns_validate_msg()
827 while (server_idx < dns_header_ancount(dns_msg->msg)) { in dns_validate_msg()
835 switch (dns_msg->response_type) { in dns_validate_msg()
841 query_name = dns_msg->msg + dns_msg->query_offset; in dns_validate_msg()
844 * hash checker can find it. in dns_validate_msg()
850 /* Add \0 and query type (A or AAAA) to the hash */ in dns_validate_msg()
861 if (ctx->queries[*query_idx].query_type == in dns_validate_msg()
869 addr = (uint8_t *)&net_sin(&info.ai_addr)-> in dns_validate_msg()
875 } else if (ctx->queries[*query_idx].query_type == in dns_validate_msg()
889 addr = (uint8_t *)&net_sin6(&info.ai_addr)-> in dns_validate_msg()
903 if (dns_msg->response_length < address_size) { in dns_validate_msg()
909 if ((dns_msg->response_position + address_size) > in dns_validate_msg()
910 dns_msg->msg_size) { in dns_validate_msg()
916 src = dns_msg->msg + dns_msg->response_position; in dns_validate_msg()
920 &ctx->queries[*query_idx]); in dns_validate_msg()
923 ctx->queries[*query_idx].query, &info, ttl); in dns_validate_msg()
932 answer_ptr = dns_msg->response_position; in dns_validate_msg()
941 dns_msg->answer_offset += dns_msg->response_position - in dns_validate_msg()
942 dns_msg->answer_offset; in dns_validate_msg()
943 dns_msg->answer_offset += dns_msg->response_length; in dns_validate_msg()
952 query_name = dns_msg->msg + dns_msg->query_offset; in dns_validate_msg()
967 if (dns_msg->response_type == DNS_RESPONSE_CNAME_NO_IP) { in dns_validate_msg()
968 uint16_t pos = dns_msg->response_position; in dns_validate_msg()
975 ret = dns_copy_qname(dns_cname->data, in dns_validate_msg()
976 &dns_cname->len, in dns_validate_msg()
1011 int query_idx = -1; in dns_read()
1015 dns_msg.msg = dns_data->data; in dns_read()
1029 invoke_query_callback(ret, NULL, &ctx->queries[query_idx]); in dns_read()
1032 release_query(&ctx->queries[query_idx]); in dns_read()
1038 ctx->queries[query_idx].query, in dns_read()
1039 ctx->queries[query_idx].query_type); in dns_read()
1064 sock = ctx->servers[server_idx].sock; in dns_write()
1065 family = ctx->servers[server_idx].dns_server.sa_family; in dns_write()
1066 server = &ctx->servers[server_idx].dns_server; in dns_write()
1067 dns_id = ctx->queries[query_idx].id; in dns_write()
1068 query_type = ctx->queries[query_idx].query_type; in dns_write()
1073 dns_qname->data, dns_qname->len, dns_id, in dns_write()
1076 return -EINVAL; in dns_write()
1082 * hash checker can find it later when we get the answer. in dns_write()
1084 for (int i = 0; i < dns_qname->len; i++) { in dns_write()
1088 /* Add \0 and query type (A or AAAA) to the hash. Note that in dns_write()
1089 * the dns_qname->len contains the length of \0 in dns_write()
1091 ctx->queries[query_idx].query_hash = in dns_write()
1092 crc16_ansi(query_name, dns_qname->len + 2); in dns_write()
1103 ret = -ENOTSUP; in dns_write()
1115 ret = -ENOENT; in dns_write()
1117 ARRAY_FOR_EACH(ctx->fds, i) { in dns_write()
1118 if (ctx->fds[i].fd == sock) { in dns_write()
1124 if (ctx->fds[i].fd < 0) { in dns_write()
1125 ctx->fds[i].fd = sock; in dns_write()
1126 ctx->fds[i].events = ZSOCK_POLLIN; in dns_write()
1143 ret = k_work_reschedule(&ctx->queries[query_idx].timer, in dns_write()
1144 ctx->queries[query_idx].timeout); in dns_write()
1152 "hash %u", query_idx, server_idx, dns_id, in dns_write()
1153 ctx->queries[query_idx].query_hash); in dns_write()
1157 NET_DBG("Cannot send query (%d)", -errno); in dns_write()
1163 if (IS_ENABLED(CONFIG_NET_IPV6) && server->sa_family == AF_INET6) { in dns_write()
1164 iface = net_if_ipv6_select_src_iface(&net_sin6(server)->sin6_addr); in dns_write()
1165 } else if (IS_ENABLED(CONFIG_NET_IPV4) && server->sa_family == AF_INET) { in dns_write()
1166 iface = net_if_ipv4_select_src_iface(&net_sin(server)->sin_addr); in dns_write()
1181 invoke_query_callback(DNS_EAI_CANCELED, NULL, &ctx->queries[slot]); in dns_resolve_cancel_slot()
1183 release_query(&ctx->queries[slot]); in dns_resolve_cancel_slot()
1192 if (ctx->queries[i].cb && ctx->queries[i].query) { in dns_resolve_cancel_all()
1206 k_mutex_lock(&ctx->lock, K_FOREVER); in dns_resolve_cancel_with_hash()
1208 if (ctx->state == DNS_RESOLVE_CONTEXT_DEACTIVATING) { in dns_resolve_cancel_with_hash()
1218 ret = -ENOENT; in dns_resolve_cancel_with_hash()
1222 NET_DBG("Cancelling DNS req %u (name %s type %d hash %u)", dns_id, in dns_resolve_cancel_with_hash()
1224 ctx->queries[i].query_type, query_hash); in dns_resolve_cancel_with_hash()
1229 k_mutex_unlock(&ctx->lock); in dns_resolve_cancel_with_hash()
1249 buf = net_buf_alloc(&dns_msg_pool, ctx->buf_timeout); in dns_resolve_cancel_with_name()
1251 return -ENOMEM; in dns_resolve_cancel_with_name()
1254 ret = dns_msg_pack_qname(&len, buf->data, in dns_resolve_cancel_with_name()
1263 return -ENOMEM; in dns_resolve_cancel_with_name()
1269 query_hash = crc16_ansi(buf->data, len + 2); in dns_resolve_cancel_with_name()
1304 ret = k_mutex_lock(&pending_query->ctx->lock, K_NO_WAIT); in query_timeout()
1320 NET_DBG("Query timeout DNS req %u type %d hash %u", pending_query->id, in query_timeout()
1321 pending_query->query_type, pending_query->query_hash); in query_timeout()
1328 (void)dns_resolve_cancel_with_hash(pending_query->ctx, in query_timeout()
1329 pending_query->id, in query_timeout()
1330 pending_query->query_hash, in query_timeout()
1331 pending_query->query); in query_timeout()
1333 k_mutex_unlock(&pending_query->ctx->lock); in query_timeout()
1348 int ret, i = -1, j = 0; in dns_resolve_name()
1357 return -EINVAL; in dns_resolve_name()
1365 return -EINVAL; in dns_resolve_name()
1376 if (net_sin(&addr)->sin_family == AF_INET6) { in dns_resolve_name()
1377 return -EPFNOSUPPORT; in dns_resolve_name()
1392 if (net_sin(&addr)->sin_family == AF_INET) { in dns_resolve_name()
1393 return -EPFNOSUPPORT; in dns_resolve_name()
1403 return -EAFNOSUPPORT; in dns_resolve_name()
1431 k_mutex_lock(&ctx->lock, K_FOREVER); in dns_resolve_name()
1433 if (ctx->state != DNS_RESOLVE_CONTEXT_ACTIVE) { in dns_resolve_name()
1434 ret = -EINVAL; in dns_resolve_name()
1440 ret = -EAGAIN; in dns_resolve_name()
1444 ctx->queries[i].cb = cb; in dns_resolve_name()
1445 ctx->queries[i].timeout = tout; in dns_resolve_name()
1446 ctx->queries[i].query = query; in dns_resolve_name()
1447 ctx->queries[i].query_type = type; in dns_resolve_name()
1448 ctx->queries[i].user_data = user_data; in dns_resolve_name()
1449 ctx->queries[i].ctx = ctx; in dns_resolve_name()
1450 ctx->queries[i].query_hash = 0; in dns_resolve_name()
1452 k_work_init_delayable(&ctx->queries[i].timer, query_timeout); in dns_resolve_name()
1454 dns_data = net_buf_alloc(&dns_msg_pool, ctx->buf_timeout); in dns_resolve_name()
1456 ret = -ENOMEM; in dns_resolve_name()
1460 dns_qname = net_buf_alloc(&dns_qname_pool, ctx->buf_timeout); in dns_resolve_name()
1462 ret = -ENOMEM; in dns_resolve_name()
1466 ret = dns_msg_pack_qname(&dns_qname->len, dns_qname->data, in dns_resolve_name()
1467 CONFIG_DNS_RESOLVER_MAX_QUERY_LEN, ctx->queries[i].query); in dns_resolve_name()
1472 ctx->queries[i].id = sys_rand16_get(); in dns_resolve_name()
1474 /* If mDNS is enabled, then send .local queries only to multicast in dns_resolve_name()
1485 ctx->queries[i].id = 0; in dns_resolve_name()
1493 *dns_id = ctx->queries[i].id; in dns_resolve_name()
1501 if (ctx->servers[j].sock < 0) { in dns_resolve_name()
1506 * a well known multicast mDNS server address. in dns_resolve_name()
1509 !ctx->servers[j].is_mdns) { in dns_resolve_name()
1514 * LLMNR multicast address unless it is a mDNS query. in dns_resolve_name()
1517 if (!ctx->servers[j].is_llmnr) { in dns_resolve_name()
1524 ret = dns_write(ctx, j, i, dns_data->data, in dns_resolve_name()
1544 ret = -ENOENT; in dns_resolve_name()
1554 release_query(&ctx->queries[i]); in dns_resolve_name()
1571 k_mutex_unlock(&ctx->lock); in dns_resolve_name()
1581 if (ctx->state != DNS_RESOLVE_CONTEXT_ACTIVE) { in dns_resolve_close_locked()
1582 return -ENOENT; in dns_resolve_close_locked()
1585 ctx->state = DNS_RESOLVE_CONTEXT_DEACTIVATING; in dns_resolve_close_locked()
1587 /* ctx->net_ctx is never used in "deactivating" state. Additionally in dns_resolve_close_locked()
1589 * time, due to required "active" -> "deactivating" state change. This in dns_resolve_close_locked()
1593 * when calling cb_recv() (which acquires ctx->lock) just before closing in dns_resolve_close_locked()
1596 k_mutex_unlock(&ctx->lock); in dns_resolve_close_locked()
1601 if (ctx->servers[i].sock < 0) { in dns_resolve_close_locked()
1605 (void)dns_dispatcher_unregister(&ctx->servers[i].dispatcher); in dns_resolve_close_locked()
1607 if (ctx->servers[i].dns_server.sa_family == AF_INET6) { in dns_resolve_close_locked()
1609 &net_sin6(&ctx->servers[i].dns_server)->sin6_addr); in dns_resolve_close_locked()
1612 &net_sin(&ctx->servers[i].dns_server)->sin_addr); in dns_resolve_close_locked()
1619 (void *)&ctx->servers[i].dns_server, in dns_resolve_close_locked()
1626 zsock_close(ctx->servers[i].sock); in dns_resolve_close_locked()
1628 ARRAY_FOR_EACH(ctx->fds, j) { in dns_resolve_close_locked()
1629 if (ctx->fds[j].fd == ctx->servers[i].sock) { in dns_resolve_close_locked()
1630 ctx->fds[j].fd = -1; in dns_resolve_close_locked()
1634 (void)dns_dispatcher_unregister(&ctx->servers[i].dispatcher); in dns_resolve_close_locked()
1636 ctx->servers[i].sock = -1; in dns_resolve_close_locked()
1639 if (--init_called <= 0) { in dns_resolve_close_locked()
1643 k_mutex_lock(&ctx->lock, K_FOREVER); in dns_resolve_close_locked()
1645 ctx->state = DNS_RESOLVE_CONTEXT_INACTIVE; in dns_resolve_close_locked()
1654 k_mutex_lock(&ctx->lock, K_FOREVER); in dns_resolve_close()
1656 k_mutex_unlock(&ctx->lock); in dns_resolve_close()
1665 if (IS_ENABLED(CONFIG_NET_IPV4) && (addr->sa_family == AF_INET) && in dns_server_exists()
1666 (ctx->servers[i].dns_server.sa_family == AF_INET)) { in dns_server_exists()
1667 if (net_ipv4_addr_cmp(&net_sin(addr)->sin_addr, in dns_server_exists()
1668 &net_sin(&ctx->servers[i].dns_server)->sin_addr)) { in dns_server_exists()
1673 if (IS_ENABLED(CONFIG_NET_IPV6) && (addr->sa_family == AF_INET6) && in dns_server_exists()
1674 (ctx->servers[i].dns_server.sa_family == AF_INET6)) { in dns_server_exists()
1675 if (net_ipv6_addr_cmp(&net_sin6(addr)->sin6_addr, in dns_server_exists()
1676 &net_sin6(&ctx->servers[i].dns_server)->sin6_addr)) { in dns_server_exists()
1721 return -ENOENT; in dns_resolve_reconfigure()
1724 k_mutex_lock(&ctx->lock, K_FOREVER); in dns_resolve_reconfigure()
1732 if (ctx->state == DNS_RESOLVE_CONTEXT_DEACTIVATING) { in dns_resolve_reconfigure()
1733 err = -EBUSY; in dns_resolve_reconfigure()
1737 if (ctx->state == DNS_RESOLVE_CONTEXT_ACTIVE) { in dns_resolve_reconfigure()
1749 k_mutex_unlock(&ctx->lock); in dns_resolve_reconfigure()