net: ipv6/addrconf: introduce a regen_min_advance sysctl
authorAlex Henrie <alexhenrie24@gmail.com>
Wed, 14 Feb 2024 06:26:31 +0000 (23:26 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 15 Feb 2024 14:34:40 +0000 (15:34 +0100)
commita5fcea2d2f790aa90b6e996d411ae2cf8db55186
tree8d0eaa45f00bfbffc6b6f8e9dd2c08b5521aca1c
parent2aa8f155b09519814e449dc19adacf01fd1367ee
net: ipv6/addrconf: introduce a regen_min_advance sysctl

In RFC 8981, REGEN_ADVANCE cannot be less than 2 seconds, and the RFC
does not permit the creation of temporary addresses with lifetimes
shorter than that:

> When processing a Router Advertisement with a
> Prefix Information option carrying a prefix for the purposes of
> address autoconfiguration (i.e., the A bit is set), the host MUST
> perform the following steps:

> 5.  A temporary address is created only if this calculated preferred
>     lifetime is greater than REGEN_ADVANCE time units.

However, some users want to change their IPv6 address as frequently as
possible regardless of the RFC's arbitrary minimum lifetime. For the
benefit of those users, add a regen_min_advance sysctl parameter that
can be set to below or above 2 seconds.

Link: https://datatracker.ietf.org/doc/html/rfc8981
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Documentation/networking/ip-sysctl.rst
include/linux/ipv6.h
include/net/addrconf.h
net/ipv6/addrconf.c