Skip to content

Commit 72db0a7

Browse files
committed
sd-radv: introduce RADV_DEFAULT_ROUTER_LIFETIME_USEC
1 parent e786c2e commit 72db0a7

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/libsystemd-network/radv-internal.h

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

src/libsystemd-network/sd-radv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ _public_ int sd_radv_new(sd_radv **ret) {
3838
*ra = (sd_radv) {
3939
.n_ref = 1,
4040
.fd = -1,
41+
.lifetime_usec = RADV_DEFAULT_ROUTER_LIFETIME_USEC,
4142
};
4243

4344
*ret = TAKE_PTR(ra);

0 commit comments

Comments
 (0)