From a637dba6e4393f0ec8f8bf294fbeb89b8e4ebc66 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Tue, 29 Jan 2013 11:36:32 +0100 Subject: [PATCH] IPv6 prefixes: conform to RFC 6204 requirement L13 --- interface-ip.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/interface-ip.c b/interface-ip.c index ea4c3dd..56f8bd9 100644 --- a/interface-ip.c +++ b/interface-ip.c @@ -456,8 +456,13 @@ interface_set_prefix_address(struct interface *iface, bool add, addr.valid_until = assignment->prefix->valid_until; if (!add) { - if (assignment->enabled) - system_del_address(l3_downlink, &addr); + if (assignment->enabled) { + time_t now = system_get_rtime(); + addr.preferred_until = now; + if (addr.valid_until - now > 7200) + addr.valid_until = now + 7200; + system_add_address(l3_downlink, &addr); + } } else { system_add_address(l3_downlink, &addr); -- 2.30.2