Skip to content

Commit 57101e5

Browse files
committed
net: llmnr_responder: Fix debug prints after receiving query
The hostname needs to have log_strdup() when printing it. Also it is useful to print information if the sending fails. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 11a8b42 commit 57101e5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

subsys/net/lib/dns/llmnr_responder.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,13 @@ static int dns_read(struct net_context *ctx,
487487
/* If the query matches to our hostname, then send reply */
488488
if (!strncasecmp(hostname, result->data + 1, hostname_len) &&
489489
(result->len - 1) >= hostname_len) {
490-
NET_DBG("LLMNR query to our hostname %s", hostname);
491-
send_response(ctx, pkt, ip_hdr, result, qtype, dns_id);
490+
NET_DBG("LLMNR query to our hostname %s",
491+
log_strdup(hostname));
492+
ret = send_response(ctx, pkt, ip_hdr, result, qtype,
493+
dns_id);
494+
if (ret < 0) {
495+
NET_DBG("Cannot send response (%d)", ret);
496+
}
492497
}
493498
} while (--queries);
494499

0 commit comments

Comments
 (0)