From: Hans Dedecker Date: Sat, 26 Dec 2020 20:41:38 +0000 (+0100) Subject: dhcpv6: fix displaying IA info X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=eac1961983b8e7a74c494feedcb878170b135072;p=project%2Fodhcp6c.git dhcpv6: fix displaying IA info Fix using ntohl and make clear if the recieved IA is either an IA_PD or IA_NA option Signed-off-by: Hans Dedecker --- diff --git a/src/dhcpv6.c b/src/dhcpv6.c index 60c0b24..51b9992 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -883,7 +883,7 @@ int dhcpv6_poll_reconfigure(void) switch (ret) { /* * Only RENEW/REBIND/INFORMATION REQUEST - * messaage transmission can be requested + * message transmission can be requested * by a RECONFIGURE */ case DHCPV6_MSG_RENEW: @@ -1346,7 +1346,7 @@ static unsigned int dhcpv6_parse_ia(void *opt, void *end) if (t1 > t2) return 0; - syslog(LOG_INFO, "IAID %04x T1 %d T2 %d", htonl(ia_hdr->iaid), t1, t2); + syslog(LOG_INFO, "%s %04x T1 %d T2 %d", ntohs(ia_hdr->type) == DHCPV6_OPT_IA_PD ? "IA_PD" : "IA_NA", ntohl(ia_hdr->iaid), t1, t2); // Update address IA dhcpv6_for_each_option(&ia_hdr[1], end, otype, olen, odata) {