]> git.decadent.org.uk Git - odhcp6c.git/blobdiff - src/dhcpv6.c
Also test for correct IA-ID for IA_NA
[odhcp6c.git] / src / dhcpv6.c
index 0c98729036cae8d587e7ef451be02ff8758d561c..aafd237b034b4a9bd187eb100f88382a3d0ee23a 100644 (file)
@@ -366,7 +366,7 @@ static void dhcpv6_send(enum dhcpv6_msg type, uint8_t trid[3], uint32_t ecs)
        struct dhcpv6_ia_hdr hdr_ia_na = {
                htons(DHCPV6_OPT_IA_NA),
                htons(sizeof(hdr_ia_na) - 4),
-               1, 0, 0
+               htonl(1), 0, 0
        };
 
        struct dhcpv6_ia_addr pa[ia_na_entries];
@@ -934,7 +934,7 @@ static int dhcpv6_handle_reply(enum dhcpv6_msg orig, _unused const int rc,
                        struct dhcpv6_ia_hdr *ia_hdr = (void*)(&odata[-4]);
 
                        // Test ID
-                       if (ia_hdr->iaid != 1 && otype == DHCPV6_OPT_IA_NA)
+                       if (ia_hdr->iaid != htonl(1) && otype == DHCPV6_OPT_IA_NA)
                                continue;
 
                        uint16_t code = DHCPV6_Success;