IPv6 prefixes: conform to RFC 6204 requirement L13
authorSteven Barth <steven@midlink.org>
Tue, 29 Jan 2013 10:36:32 +0000 (11:36 +0100)
committerSteven Barth <steven@midlink.org>
Tue, 29 Jan 2013 10:36:32 +0000 (11:36 +0100)
interface-ip.c

index ea4c3ddbf989b31c22481caee15b8e2f77c8ec6a..56f8bd9468f38694e998759d930f57859526f87c 100644 (file)
@@ -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);