RMerl/asuswrt-merlin — pull request #591 by pinwing (2014-04-06 20:21:46+00:00)
Title: Set valid and preferred lifetimes in router advertisements to be no later than the lifetimes of the delegated prefix

radvd would sent out router advertisements using the default valid and preferred lifetimes.

In case of DHCPv6-PD, this causes a violation of [RFC3633](http://tools.ietf.org/html/rfc3633#section-12.1), which states:
> If the requesting router assigns a delegated prefix to a link to which the router is attached, and begins to send router advertisements for the prefix on the link, the requesting router MUST set the valid lifetime in those advertisements to be no later than the valid lifetime specified in the IA_PD Prefix option. A requesting router MAY use the preferred lifetime specified in the IA_PD Prefix option.

If AdvValidLifetime is specified, radvd actually requires that AdvPreferredLifetime is also specified (unless the default preferred lifetime value is less than the explicitly configure valid lifetime value). So I have included both lifetimes in this pull request.

In case the lifetimes are specified, I have also included the DecrementLifetimes option in radvd.conf, as recommended in its man page:
> This option is intended to be used in conjunction with a DHCPv6 client that is using the Identity Association for Prefix Delegation (IA_PD) option to acquire a prefix from a Delegating Router for use by a Requesting Router. In this scenario, the prefix(es) from within the delegated prefix that are announced by radvd would age in parallel with and at the same rate as the delegated prefix, and expire at approximately the same time, if the delegated prefix's life isn't extended.

Sending SIGUSR1 to radvd to reset lifetimes is unnecessary, as /sbin/dhcp6c-state will call start_radvd() which in turn will kill the current instance of radvd and will start a new instance.