diff options
author | Steven Barth <steven@midlink.org> | 2014-10-18 17:46:34 +0200 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2014-10-18 17:46:34 +0200 |
commit | b461334ab277b6e8fd1622ab7c8a655363bd3f6c (patch) | |
tree | c7e32516ecafea9a3eb5c92fb2f565fd1f4f8b43 | |
parent | ff9d2a001bea612cad05d9d317f0f0ca555aa72f (diff) |
dhcpv6: fix calculation of T1 and T2
-rw-r--r-- | src/dhcpv6-ia.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c index 6ece528..b21b39e 100644 --- a/src/dhcpv6-ia.c +++ b/src/dhcpv6-ia.c @@ -800,9 +800,6 @@ static size_t append_reply(uint8_t *buf, size_t buflen, uint16_t status, #endif datalen += entrlen + 4; } else { - if (!a->accept_reconf && iface->managed < RELAYD_MANAGED_NO_AFLAG) - prefix_pref = 1; - struct dhcpv6_ia_addr n = { .type = htons(DHCPV6_OPT_IA_ADDR), .len = htons(sizeof(n) - 4), @@ -813,6 +810,9 @@ static size_t append_reply(uint8_t *buf, size_t buflen, uint16_t status, n.addr.s6_addr32[3] = htonl(a->assigned); size_t entrlen = sizeof(n) - 4; + if (!a->accept_reconf && iface->managed < RELAYD_MANAGED_NO_AFLAG) + n.preferred = htonl(1); + #ifdef DHCPV6_OPT_PREFIX_CLASS if (iface->ia_addr[i].has_class) { entrlen += sizeof(pclass); |