Re: [PATCH net v3] ipv6: reject wrapped temporary address preferred lifetimes
From: Xia Yan
Date: Sat Oct 31 2026 - 07:45:07 EST
Hi,
One question on the clamp added by f4bcbf360ac8, separate from the
wrap fixed here - I don't think this patch needs to address it. I have
only followed the source and have not run this case.
As far as I can tell the clamp's termination relies on cfg.valid_lft
and if_public_preferred_lft being finite. Consider a public address
with both lifetimes at INFINITY_LIFETIME and a large regen_advance,
with no wrap involved. For example with regen_min_advance=2,
regen_max_retry=3, dad_transmits=1, an RA Retrans Timer around
28,600,000 ms and HZ=1000, regen_advance is around 85802; raising
regen_max_retry via sysctl has the same effect.
If temp_prefered_lft is set below regen_advance, the effective
max_desync_factor goes negative, desync_factor is reset to 0, and the
clamp engages on every creation. The clamped preferred lifetime
regen_advance + age + 1 then passes all three checks, including the
new one. But the temporary address inherits the public address's
tstamp, so addrconf_verify_rtnl() finds it due for regeneration one
second after each creation: one new temporary address per second,
each living about temp_valid_lft. Creation is only refused once age
grows enough that regen_advance + age + 1 exceeds cfg.valid_lft,
which here is just temp_valid_lft, so the accumulation is bounded,
but with the numbers above it can still reach tens of thousands of
addresses.
Is this finite-lifetime assumption part of the intended behavior of
the clamp, or would it be worth tightening separately?
Thanks,
Xia