summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2017-01-02 17:10:14 +0100
committerHans Dedecker <dedeckeh@gmail.com>2017-01-02 17:10:14 +0100
commit561890e1ce8aa467a83db5f05e563a00d4d9aa47 (patch)
tree8004b207933f2aaa1b5b3655eb88370f2c6884c4
parent0b45fce0859e4726e27f408016ef2f7d210c847f (diff)
dhcpv6-ia: update valid_until only for non static DHCPv6 leases
Update valid_until lifetime only for non static DHCPv6 leases otherwise the lifetime of a static lease is not infinite anymore Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
-rw-r--r--src/dhcpv6-ia.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c
index df69759..c8786c3 100644
--- a/src/dhcpv6-ia.c
+++ b/src/dhcpv6-ia.c
@@ -450,7 +450,7 @@ static void managed_handle_pd_data(struct ustream *s, _unused int bytes_new)
if (first && c->managed_size == 0)
free_dhcpv6_assignment(c);
- else if (first)
+ else if (first & !(c->flags & OAF_STATIC))
c->valid_until = now + 150;
}
@@ -460,7 +460,9 @@ static void managed_handle_pd_done(struct ustream *s)
{
struct dhcpv6_assignment *c = container_of(s, struct dhcpv6_assignment, managed_sock);
- c->valid_until = odhcpd_time() + 15;
+ if (!(c->flags & OAF_STATIC))
+ c->valid_until = odhcpd_time() + 15;
+
c->managed_size = 0;
if (c->accept_reconf)
@@ -484,7 +486,10 @@ static bool assign_pd(struct interface *iface, struct dhcpv6_assignment *assign)
iaidbuf, assign->iaid, assign->length);
ustream_write_pending(&assign->managed_sock.stream);
assign->managed_size = -1;
- assign->valid_until = odhcpd_time() + 15;
+
+ if (!(assign->flags & OAF_STATIC))
+ assign->valid_until = odhcpd_time() + 15;
+
list_add(&assign->head, &iface->ia_assignments);
/* Wait initial period of up to 250ms for immediate assignment */