dhcpv6: fix displaying IA info
authorHans Dedecker <dedeckeh@gmail.com>
Sat, 26 Dec 2020 20:41:38 +0000 (21:41 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Sat, 26 Dec 2020 20:46:18 +0000 (21:46 +0100)
Fix using ntohl and make clear if the recieved IA is either an IA_PD or
IA_NA option

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
src/dhcpv6.c

index 60c0b24ab3606c18e51b26f115f49eb9a109fb94..51b99924991e1ea46f06142a1f9e20bf3c65ff9e 100644 (file)
@@ -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) {