From: Hans Dedecker Date: Mon, 7 Dec 2020 20:17:16 +0000 (+0100) Subject: dhcpv6: improve syslog tracing X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=48071182e63e4f3b73885daaecee148c9fc1c886;p=project%2Fodhcp6c.git dhcpv6: improve syslog tracing Improve syslog tracing by displaying the DHCPv6 message type in the received DHCPv6 message and requested DHCPv6 message type in reply to a RECONFIGURE Signed-off-by: Hans Dedecker --- diff --git a/src/dhcpv6.c b/src/dhcpv6.c index 11cc8b6..5699296 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -660,6 +660,7 @@ int dhcpv6_request(enum dhcpv6_msg type) .msg_iov = &iov, .msg_iovlen = 1, .msg_control = cmsg_buf.buf, .msg_controllen = sizeof(cmsg_buf)}; struct in6_pktinfo *pktinfo = NULL; + const struct dhcpv6_header *hdr = (const struct dhcpv6_header *)buf; // Check for pending signal if (odhcp6c_signal_process()) @@ -703,8 +704,8 @@ int dhcpv6_request(enum dhcpv6_msg type) round_start = odhcp6c_get_milli_time(); elapsed = round_start - start; - syslog(LOG_NOTICE, "Got a valid reply after %"PRIu64"ms", - elapsed); + syslog(LOG_NOTICE, "Got a valid %s after %"PRIu64"ms", + dhcpv6_msg_to_str(hdr->msg_type), elapsed); if (retx->handler_reply) len = retx->handler_reply(type, rc, opt, opt_end, &addr); @@ -855,9 +856,8 @@ static int dhcpv6_handle_reconfigure(enum dhcpv6_msg orig, const int rc, // Fall through case DHCPV6_MSG_INFO_REQ: msg = odata[0]; - syslog(LOG_NOTICE, "Got a %s (msg-type %s)", - dhcpv6_msg_to_str(otype), - dhcpv6_msg_to_str(msg)); + syslog(LOG_NOTICE, "Need to respond with %s in reply to %s", + dhcpv6_msg_to_str(msg), dhcpv6_msg_to_str(DHCPV6_MSG_RECONF)); break; default: