summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2024-07-09 16:15:43 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2024-07-09 16:15:43 +0000
commit65a9a5efc9c9feaf176f6e5d660eb4ba825051bd (patch)
treea80d8ded5eaedbf16d086902683360a3300183b9 /sbin
parentd1b6914e41879a1705ad3b9fc6f3118e489ffe13 (diff)
Skip prefixes with vltime 0.
Servers indicate unusable prefixes with vltime 0 when we are in state reboot and probably hand us new, valid prefixes. In IPv4 dhcp we would receive a NACK instead...
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dhcp6leased/engine.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sbin/dhcp6leased/engine.c b/sbin/dhcp6leased/engine.c
index 9e457f8bad0..e708f8ea1fd 100644
--- a/sbin/dhcp6leased/engine.c
+++ b/sbin/dhcp6leased/engine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: engine.c,v 1.15 2024/07/09 13:27:18 florian Exp $ */
+/* $OpenBSD: engine.c,v 1.16 2024/07/09 16:15:42 florian Exp $ */
/*
* Copyright (c) 2017, 2021, 2024 Florian Obser <florian@openbsd.org>
@@ -977,18 +977,25 @@ parse_ia_pd_options(uint8_t *p, size_t len, struct prefix *prefix)
ntohl(iaprefix.vltime), inet_ntop(AF_INET6,
&iaprefix.prefix, ntopbuf, INET6_ADDRSTRLEN),
iaprefix.prefix_len);
+
if (ntohl(iaprefix.vltime) < ntohl(iaprefix.pltime)) {
log_warnx("%s: vltime < pltime, ignoring IA_PD",
__func__);
break;
}
+ if (ntohl(iaprefix.vltime) == 0) {
+ log_debug("%s: vltime == 0, ignoring IA_PD",
+ __func__);
+ break;
+ }
+
prefix->prefix = iaprefix.prefix;
prefix->prefix_len = iaprefix.prefix_len;
prefix->vltime = ntohl(iaprefix.vltime);
prefix->pltime = ntohl(iaprefix.pltime);
- /* make sure prefix is mask correctly */
+ /* make sure prefix is masked correctly */
memset(&mask, 0, sizeof(mask));
in6_prefixlen2mask(&mask, prefix->prefix_len);
for (i = 0; i < 16; i++)