while ((o = dhcp6_findoption(D6_OPTION_IA_ADDR, d, l))) {
l -= ((const uint8_t *)o - d);
d += ((const uint8_t *)o - d);
- u32 = htons(o->len);
+ u32 = ntohs(o->len);
l -= sizeof(*o) + u32;
d += sizeof(*o) + u32;
if (u32 < 24) {
while ((o = dhcp6_findoption(D6_OPTION_IAPREFIX, d, l))) {
l -= ((const uint8_t *)o - d);
d += ((const uint8_t *)o - d);
- u32 = htons(o->len);
+ u32 = ntohs(o->len);
l -= sizeof(*o) + u32;
d += sizeof(*o) + u32;
if (u32 < 25) {
while ((o = dhcp6_findoption(ifo->ia_type, d, l))) {
l -= ((const uint8_t *)o - d);
d += ((const uint8_t *)o - d);
- ol = htons(o->len);
+ ol = ntohs(o->len);
l -= sizeof(*o) + ol;
d += sizeof(*o) + ol;
u32 = ifo->ia_type == D6_OPTION_IA_TA ? 4 : 12;