git: 13c70ef568c3 - releng/15.1 - rtadvd(8): Honor pltime/vltime in interface declarations
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 07 May 2026 20:19:20 UTC
The branch releng/15.1 has been updated by cperciva:
URL: https://cgit.FreeBSD.org/src/commit/?id=13c70ef568c35b974ff3c19a7b6834e8486a6b42
commit 13c70ef568c35b974ff3c19a7b6834e8486a6b42
Author: tickerguy <karl@denninger.net>
AuthorDate: 2025-09-29 16:05:29 +0000
Commit: Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2026-05-07 20:19:02 +0000
rtadvd(8): Honor pltime/vltime in interface declarations
Currently rtadvd ignores interface pltime/vltime specifications
unless the (static) address range is also included in the config file.
This extends the validity of a pltime and/or vltime stanza in
the config file for an interface to delegated addresses from
an upstream provider.
Approved by: re (cperciva)
Signed-off-by: tickerguy <karl@denninger.net>
PR: 288426
Reviewed by: pouria
Pull Request: https://github.com/freebsd/freebsd-src/pull/1863
(cherry picked from commit 103f9883d1ed7431c432caa6ab9c61cd4d0831d0)
(cherry picked from commit 18caefe847086a9e89812db600c852b225467090)
---
usr.sbin/rtadvd/config.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/usr.sbin/rtadvd/config.c b/usr.sbin/rtadvd/config.c
index 628ca3be886f..c02997337da3 100644
--- a/usr.sbin/rtadvd/config.c
+++ b/usr.sbin/rtadvd/config.c
@@ -1095,6 +1095,7 @@ get_prefix(struct rainfo *rai)
ifi = rai->rai_ifinfo;
for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
+ int64_t val64;
int plen;
if (strcmp(ifa->ifa_name, ifi->ifi_ifname) != 0)
@@ -1143,9 +1144,26 @@ get_prefix(struct rainfo *rai)
"<%s> add %s/%d to prefix list on %s",
__func__, ntopbuf, pfx->pfx_prefixlen, ifi->ifi_ifname);
+ MAYHAVE(val64, "vltime", DEF_ADVVALIDLIFETIME);
+ if (val64 < 0 || val64 > 0xffffffff) {
+ syslog(LOG_WARNING,
+ "<%s> vltime (%" PRIu64 ") for %s/%d on %s "
+ "is out of range, use default value instead.", __func__,
+ val64, ntopbuf, pfx->pfx_prefixlen, ifi->ifi_ifname);
+ pfx->pfx_validlifetime = DEF_ADVVALIDLIFETIME;
+ } else
+ pfx->pfx_validlifetime = val64;
+ MAYHAVE(val64, "pltime", DEF_ADVPREFERREDLIFETIME);
+ if (val64 < 0 || val64 > 0xffffffff) {
+ syslog(LOG_WARNING,
+ "<%s> pltime (%" PRIu64 ") for %s/%d on %s "
+ "is out of range, use default value instead.", __func__,
+ val64, ntopbuf, pfx->pfx_prefixlen, ifi->ifi_ifname);
+ pfx->pfx_preflifetime = DEF_ADVPREFERREDLIFETIME;
+ } else
+ pfx->pfx_preflifetime = val64;
+
/* set other fields with protocol defaults */
- pfx->pfx_validlifetime = DEF_ADVVALIDLIFETIME;
- pfx->pfx_preflifetime = DEF_ADVPREFERREDLIFETIME;
pfx->pfx_onlinkflg = 1;
pfx->pfx_autoconfflg = 1;
pfx->pfx_origin = PREFIX_FROM_KERNEL;