summaryrefslogtreecommitdiffhomepage
path: root/src/router.c
diff options
context:
space:
mode:
authorNick Hainke <vincent@systemli.org>2021-01-02 23:27:03 +0100
committerHans Dedecker <dedeckeh@gmail.com>2021-01-03 15:42:49 +0100
commit3bda90079ec5574ef469e2a7804808302f17769d (patch)
treea3a7e8ce9f1f25d211838631b31d587f9f293205 /src/router.c
parentb75bcad7bd5fd03f64011a532b9960d78e4aac22 (diff)
odhcpd: add option for setting preferred lifetime
"valid_lft" and "preferred_lft" are different. If the "preferred_lft" is expired the prefix should be avoided in source prefix selection. However, the interface is allowed to still receive downstream traffic. preferred_lfetime: Limit for preferred lifetime of a prefix If you want the old behavior, you have to set preferred_lifetime to the same value as leasetime. Signed-off-by: Nick Hainke <vincent@systemli.org> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/router.c')
-rw-r--r--src/router.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/router.c b/src/router.c
index 06f3a66..d6ab4bb 100644
--- a/src/router.c
+++ b/src/router.c
@@ -552,8 +552,8 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr
preferred = TIME_LEFT(addr->preferred, now);
if (iface->ra_useleasetime &&
- preferred > iface->dhcp_leasetime)
- preferred = iface->dhcp_leasetime;
+ preferred > iface->preferred_lifetime)
+ preferred = iface->preferred_lifetime;
}
valid = TIME_LEFT(addr->valid, now);