summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Dedecker2020-12-07 20:17:16 +0000
committerHans Dedecker2020-12-07 20:23:40 +0000
commit48071182e63e4f3b73885daaecee148c9fc1c886 (patch)
tree3bda1f757444c385e1586eddb38379111395da02
parentfaed29aa733cd3e7c0269d5dc2fc6a8e1d35f1ce (diff)
downloadodhcp6c-48071182e63e4f3b73885daaecee148c9fc1c886.tar.gz
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 <dedeckeh@gmail.com>
-rw-r--r--src/dhcpv6.c10
1 files changed, 5 insertions, 5 deletions
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: