Skip to content
Permalink
Browse files

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 <jukka.rissanen@linux.intel.com>
  • Loading branch information...
jukkar committed Jul 4, 2019
1 parent 11a8b42 commit 57101e56f4e1f60c95769a1acf48a6e9e3a9b221
Showing with 7 additions and 2 deletions.
  1. +7 −2 subsys/net/lib/dns/llmnr_responder.c
@@ -487,8 +487,13 @@ static int dns_read(struct net_context *ctx,
/* If the query matches to our hostname, then send reply */
if (!strncasecmp(hostname, result->data + 1, hostname_len) &&
(result->len - 1) >= hostname_len) {
NET_DBG("LLMNR query to our hostname %s", hostname);
send_response(ctx, pkt, ip_hdr, result, qtype, dns_id);
NET_DBG("LLMNR query to our hostname %s",
log_strdup(hostname));
ret = send_response(ctx, pkt, ip_hdr, result, qtype,
dns_id);
if (ret < 0) {
NET_DBG("Cannot send response (%d)", ret);
}
}
} while (--queries);

0 comments on commit 57101e5

Please sign in to comment.
You can’t perform that action at this time.