summaryrefslogtreecommitdiff
path: root/accel-pppd/ipv6/dhcpv6.c
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2011-08-30 18:05:58 +0400
committerKozlov Dmitry <xeb@mail.ru>2011-08-30 18:05:58 +0400
commitb8bcff4866bb5a4c18af7bbf6297eb7bed324544 (patch)
tree2696b7fe3285c057d02b35ac2be7d10e49f6a68e /accel-pppd/ipv6/dhcpv6.c
parent50cdd575445a4da9104bf4a1bb265f18da8f054f (diff)
downloadaccel-ppp-b8bcff4866bb5a4c18af7bbf6297eb7bed324544.tar.gz
accel-ppp-b8bcff4866bb5a4c18af7bbf6297eb7bed324544.zip
dhcpv6: set T1/T2 fields in IA_NA/IA_PD
Diffstat (limited to 'accel-pppd/ipv6/dhcpv6.c')
-rw-r--r--accel-pppd/ipv6/dhcpv6.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/accel-pppd/ipv6/dhcpv6.c b/accel-pppd/ipv6/dhcpv6.c
index 88ba9f9..8e994af 100644
--- a/accel-pppd/ipv6/dhcpv6.c
+++ b/accel-pppd/ipv6/dhcpv6.c
@@ -240,8 +240,8 @@ static void dhcpv6_send_reply(struct dhcpv6_packet *req, struct dhcpv6_pd *pd, i
memcpy(opt1->hdr + 1, opt->hdr + 1, ntohs(opt1->hdr->len));
ia_na = (struct dhcpv6_opt_ia_na *)opt1->hdr;
- ia_na->T1 = 0;
- ia_na->T2 = 0;
+ ia_na->T1 = conf_pref_lifetime == -1 ? -1 : htonl(conf_pref_lifetime / 2);
+ ia_na->T2 = conf_pref_lifetime == -1 ? -1 : htonl((conf_pref_lifetime * 4) / 5);
if (req->hdr->type == D6_RENEW && pd->addr_iaid != ia_na->iaid) {
insert_status(reply, opt1, D6_STATUS_NoBinding);
@@ -299,8 +299,8 @@ static void dhcpv6_send_reply(struct dhcpv6_packet *req, struct dhcpv6_pd *pd, i
memcpy(opt1->hdr + 1, opt->hdr + 1, ntohs(opt1->hdr->len));
ia_na = (struct dhcpv6_opt_ia_na *)opt1->hdr;
- ia_na->T1 = 0;
- ia_na->T2 = 0;
+ ia_na->T1 = conf_pref_lifetime == -1 ? -1 : htonl(conf_pref_lifetime / 2);
+ ia_na->T2 = conf_pref_lifetime == -1 ? -1 : htonl((conf_pref_lifetime * 4) / 5);
if (!pd->ipv6_dp)
pd->ipv6_dp = ipdb_get_ipv6_prefix(req->ppp);