1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

sd-radv: introduce RADV_DEFAULT_ROUTER_LIFETIME_USEC

This commit is contained in:
Yu Watanabe 2021-10-25 01:03:30 +09:00
parent e786c2e50f
commit 72db0a714b
2 changed files with 11 additions and 0 deletions

View File

@ -25,6 +25,16 @@
* Default: 0.33 * MaxRtrAdvInterval If MaxRtrAdvInterval >= 9 seconds; otherwise, the Default is
* MaxRtrAdvInterval (Note, this should be a typo. We use 0.75 * MaxRtrAdvInterval). */
#define RADV_DEFAULT_MIN_TIMEOUT_USEC (RADV_DEFAULT_MAX_TIMEOUT_USEC / 3)
/* RFC 4861 section 6.2.4.
* AdvDefaultLifetime
* The value to be placed in the Router Lifetime field of Router Advertisements sent from the interface,
* in seconds. MUST be either zero or between MaxRtrAdvInterval and 9000 seconds. A value of zero
* indicates that the router is not to be used as a default router. These limits may be overridden by
* specific documents that describe how IPv6 operates over different link layers. For instance, in a
* point-to-point link the peers may have enough information about the number and status of devices at
* the other end so that advertisements are needed less frequently.
* Default: 3 * MaxRtrAdvInterval */
#define RADV_DEFAULT_ROUTER_LIFETIME_USEC (3 * RADV_DEFAULT_MAX_TIMEOUT_USEC)
/* RFC 4861 section 10.
* MAX_INITIAL_RTR_ADVERT_INTERVAL 16 seconds
* MAX_INITIAL_RTR_ADVERTISEMENTS 3 transmissions

View File

@ -38,6 +38,7 @@ _public_ int sd_radv_new(sd_radv **ret) {
*ra = (sd_radv) {
.n_ref = 1,
.fd = -1,
.lifetime_usec = RADV_DEFAULT_ROUTER_LIFETIME_USEC,
};
*ret = TAKE_PTR(ra);