summaryrefslogtreecommitdiffstats
path: root/src/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-09-01 11:56:53 +0100
committerRoy Marples <roy@marples.name>2020-09-01 11:56:53 +0100
commitb581e67fe7065d45756ce0a54697ac9913767d75 (patch)
treeb4c789ee71bf7845e232571013910bc098075d75 /src/ipv6.c
parent420382171230e4a6bde8e8907632376bacc055ba (diff)
downloaddhcpcd-b581e67fe7065d45756ce0a54697ac9913767d75.tar.xz
DHCP: Don't set address lifetimes when extending leases
Otherwise the kernel WILL remove them. dhcpcd already manages address removal when needed because some OS's do not support address lifetimes even for IPv6. While here apply the same logic to IPv6.
Diffstat (limited to 'src/ipv6.c')
-rw-r--r--src/ipv6.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ipv6.c b/src/ipv6.c
index 1cd02bec..5442ebde 100644
--- a/src/ipv6.c
+++ b/src/ipv6.c
@@ -679,6 +679,14 @@ ipv6_addaddr1(struct ipv6_addr *ia, const struct timespec *now)
/* Adjust plftime and vltime based on acquired time */
pltime = ia->prefix_pltime;
vltime = ia->prefix_vltime;
+
+ if (ifp->options->options & DHCPCD_LASTLEASE_EXTEND) {
+ /* We don't want the kernel to expire the address.
+ * The saved times will be re-applied to the ia
+ * before exiting this function. */
+ ia->prefix_vltime = ia->prefix_pltime = ND6_INFINITE_LIFETIME;
+ }
+
if (timespecisset(&ia->acquired) &&
(ia->prefix_pltime != ND6_INFINITE_LIFETIME ||
ia->prefix_vltime != ND6_INFINITE_LIFETIME))