fff-ra: set preferred lifetime smaller than valid lifetime

A recent change (b26399283a) introduced an upper limit for the preferred
and valid lifetimes, so the statically configured addresses on the client
interface do not result in infinite lifetimes.

This upper bound is derived from the dhcp lease time. However, the
preferred lifetime is unexpectedly bound by an explicit configuration
option in recent versions of odhcpd. Due to our short dhcp leasetime,
the default value of this option is higher than the lease time, which
results preferred lifetimes longer than the valid lifetime.

As this behavior is rather unintuitive, a proper fix for it should be
done upstream (see #238). Until then, lower the preferred lifetime
option to the same value as our leasetime.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <freifunk@dresel.systems>
This commit is contained in:
Fabian Bläse 2022-04-10 15:09:41 +02:00
parent f3b1604ff3
commit bc3c0b717d
1 changed files with 6 additions and 0 deletions

View File

@ -5,6 +5,12 @@ uci batch <<EOF
set dhcp.client.ra_default='2'
set dhcp.client.ra_management='0'
set dhcp.client.ra_useleasetime='1'
# Work around unexpected behavior of odhcpd (see #238).
#
# This value has to be less then or equal to
# dhcp.client.leasetime (set in fff-dhcp).
set dhcp.client.preferred_lifetime='1h'
EOF
exit 0