diff options
author | Steven Barth <steven@midlink.org> | 2013-01-29 11:36:32 +0100 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2013-01-29 11:36:32 +0100 |
commit | a637dba6e4393f0ec8f8bf294fbeb89b8e4ebc66 (patch) | |
tree | ac1770437f0f266488be96175d6bec550d902b1b | |
parent | 889f3236fde274d6ebff23fe62c5cd66ed8b3eb7 (diff) |
IPv6 prefixes: conform to RFC 6204 requirement L13
-rw-r--r-- | interface-ip.c | 9 |
1 files 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); |