Go to file
Martin Osvald 476431d1b1 Add 99-prefixlen hook to override DHCPv6 IA_NA prefix length
Resolves: RHEL-94932

dhcpcd assigns DHCPv6 IA_NA addresses with /128 per RFC 8415.
Some deployments need a shorter prefix (e.g. /64) to match routing
policy, which dhclient supported via --address-prefix-len.

The 99-prefixlen hook provides equivalent behavior. When
DHCPCD_IPV6_PREFIXLEN is set in dhcpcd.conf via the env directive,
the hook deletes the /128 and immediately replaces it with the
requested prefix on BOUND6, RENEW6, REBIND6, and REBOOT6 events.

The del+replace sequence is race-safe: the hook runs synchronously
inside dhcpcd's processing, so the replacement address is already in
the kernel before dhcpcd drains the RTM_DELADDR netlink event. The
if_addrflags6 guard in dhcpcd finds the address still present (by
bytes) and skips the deletion handler, so /128 is never re-added.

ip addr replace (NLM_F_REPLACE|NLM_F_CREATE) handles all lease events
correctly: it adds the address fresh on BOUND6 and updates lifetimes
on RENEW6 without requiring the address to be absent first.

Usage in /etc/dhcpcd.conf:

    interface eth0
        ia_na 1
        env DHCPCD_IPV6_PREFIXLEN=64

The hook is a no-op when DHCPCD_IPV6_PREFIXLEN is not set.
2026-07-24 16:07:56 +02:00
.fmf Update of fmf plans and gating for c10s 2024-06-27 10:45:40 +02:00
.gitignore Update to 10.0.6 (rhbz#2255164) 2023-12-21 15:09:49 +01:00
99-prefixlen Add 99-prefixlen hook to override DHCPv6 IA_NA prefix length 2026-07-24 16:07:56 +02:00
changelog Convert to %autorelease and %autochangelog 2023-04-24 22:39:58 +02:00
ci.fmf Update of fmf plans and gating for c10s 2024-06-27 10:45:40 +02:00
dhcpcd-CVE-2026-14258.patch Fix CVE-2026-14258 2026-07-01 13:17:19 +02:00
dhcpcd-online.service Initial setup of the repo 2016-02-19 08:54:21 +01:00
dhcpcd-RHEL-72083.patch Allow the rt_sigprocmask syscall (RHEL-72083) 2025-01-02 12:07:49 +01:00
dhcpcd.service Initial setup of the repo 2016-02-19 08:54:21 +01:00
dhcpcd.spec Add 99-prefixlen hook to override DHCPv6 IA_NA prefix length 2026-07-24 16:07:56 +02:00
dhcpcd@.service Enable again binding to device 2021-03-22 08:56:02 +01:00
gating.yaml Update of fmf plans and gating for c10s 2024-06-27 10:45:40 +02:00
plans.fmf Update location of fmf plans 2025-07-15 14:58:11 +02:00
roy-marples.name.asc Update to 9.4.1 (#2016639) 2021-11-01 21:08:58 +01:00
sources Update to 10.0.6 (rhbz#2255164) 2023-12-21 15:09:49 +01:00
systemd-sysusers.conf Modernize spec to recent changes 2021-03-19 12:50:20 +01:00
systemd-tmpfiles.conf Create /var/lib/dhcpcd directory through systemd-tmpfiles 2026-01-08 16:00:59 +01:00