projects
/
project
/
odhcpd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use leaetime as base for T1 and T2 upper bound
[project/odhcpd.git]
/
src
/
dhcpv6-ia.c
diff --git
a/src/dhcpv6-ia.c
b/src/dhcpv6-ia.c
index
25c11d7
..
181973d
100644
(file)
--- a/
src/dhcpv6-ia.c
+++ b/
src/dhcpv6-ia.c
@@
-718,8
+718,14
@@
static size_t append_reply(uint8_t *buf, size_t buflen, uint16_t status,
datalen += sizeof(stat);
} else {
if (a) {
datalen += sizeof(stat);
} else {
if (a) {
- uint32_t pref = 3600;
- uint32_t valid = 3600;
+ uint32_t leasetime = iface->dhcpv4_leasetime;
+ if (leasetime == 0)
+ leasetime = 3600;
+ else if (leasetime < 60)
+ leasetime = 60;
+
+ uint32_t pref = leasetime;
+ uint32_t valid = leasetime;
struct odhcpd_ipaddr *addrs = (a->managed) ? a->managed : iface->ia_addr;
size_t addrlen = (a->managed) ? (size_t)a->managed_size : iface->ia_addr_len;
struct odhcpd_ipaddr *addrs = (a->managed) ? a->managed : iface->ia_addr;
size_t addrlen = (a->managed) ? (size_t)a->managed_size : iface->ia_addr_len;
@@
-1184,6
+1190,8
@@
ssize_t dhcpv6_handle_ia(uint8_t *buf, size_t buflen, struct interface *iface,
}
} else if (hdr->msg_type == DHCPV6_MSG_CONFIRM && ia_addr_present) {
// Send NOTONLINK for CONFIRM with addr present so that clients restart connection
}
} else if (hdr->msg_type == DHCPV6_MSG_CONFIRM && ia_addr_present) {
// Send NOTONLINK for CONFIRM with addr present so that clients restart connection
+ status = DHCPV6_STATUS_NOTONLINK;
+ ia_response_len = append_reply(buf, buflen, status, ia, a, iface, true);
notonlink = true;
}
notonlink = true;
}