router: inherit user-assigned preferred_lifetime
authorPaul Donald <newtwen@gmail.com>
Tue, 9 Apr 2024 03:04:04 +0000 (05:04 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Tue, 7 May 2024 22:06:18 +0000 (00:06 +0200)
commit3b4e06055900c7e3dc6462ad17ff897093b1fc27
tree8378f6d30c10187e9aa56ce7ad1f70ad05e5af17
parent4c2b51eab3687da0b90b399152480f295e5ba575
router: inherit user-assigned preferred_lifetime

Inherit preferred_lifetime value irrespective of whether ra_useleasetime
is set or not.

User-provided values for preferred_lifetime are now assigned, instead of
ignored.

Before:
==
ICMPv6 Option (Prefix information : fd51:1c2a:8909::/64)
    Type: Prefix information (3)
    Length: 4 (32 bytes)
    Prefix Length: 64
    Flag: 0xc0, On-link flag(L), Autonomous address-configuration flag(A)
    Valid Lifetime: Infinity (4294967295)
    Preferred Lifetime: Infinity (4294967295)
    Reserved
    Prefix: fd51:1c2a:8909::
==

After (preferred_lifetime set to 7 minutes):
==
ICMPv6 Option (Prefix information : fd51:1c2a:8909::/64)
    Type: Prefix information (3)
    Length: 4 (32 bytes)
    Prefix Length: 64
    Flag: 0xc0, On-link flag(L), Autonomous address-configuration flag(A)
    Valid Lifetime: Infinity (4294967295)
    Preferred Lifetime: 420
    Reserved
    Prefix: fd51:1c2a:8909::
==

Signed-off-by: Paul Donald <newtwen@gmail.com>
Reviewed-by: Daniel Golle <daniel@makrotopia.org>
[ fix comment format and improve commit description ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
src/router.c