dhcpv4: add ubus_get_address4 ubus_get_mask4 function
[project/odhcpd.git] / src / dhcpv6-ia.c
index a6ea66f..0bcb453 100644 (file)
@@ -758,7 +758,7 @@ static size_t append_reply(uint8_t *buf, size_t buflen, uint16_t status,
 
                                        if (datalen + entrlen + 4 > buflen ||
                                                        (a->assigned == 0 && a->managed_size == 0) ||
-                                                       (!a->managed_size && a->length < p.preferred))
+                                                       (!a->managed_size && a->length <= addrs[i].prefix))
                                                continue;
 
                                        memcpy(buf + datalen, &p, sizeof(p));