summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/radv-internal.h
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-10-25 02:44:29 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-10-27 23:58:28 +0900
commit95e104e04957cd984600ecdaa4216950303031dc (patch)
tree4f60a694a7626d5ed1907cf17631ee9f3b432659 /src/libsystemd-network/radv-internal.h
parenteef5ebec9775d15b07f5660b501cb8fc7f3446c8 (diff)
downloadsystemd-95e104e04957cd984600ecdaa4216950303031dc.tar.gz
sd-radv: make prefix/route prefix lifetime can be specified with independently with valid_until
Previously, valid_until (or preferred_until for preferred lifetime) was calculated from lifetime. So, when an upstream interface acquire a dynamic prefix (e.g. through DHCPv6-PD) with long lifetime, then sd-radv advertise the same lifetime. It may not be desired for some situations.
Diffstat (limited to 'src/libsystemd-network/radv-internal.h')
-rw-r--r--src/libsystemd-network/radv-internal.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/libsystemd-network/radv-internal.h b/src/libsystemd-network/radv-internal.h
index 260d1a826f..df3c22c8c0 100644
--- a/src/libsystemd-network/radv-internal.h
+++ b/src/libsystemd-network/radv-internal.h
@@ -105,8 +105,8 @@ struct sd_radv {
uint8_t length; \
uint8_t prefixlen; \
uint8_t flags; \
- be32_t valid_lifetime; \
- be32_t preferred_lifetime; \
+ be32_t lifetime_valid; \
+ be32_t lifetime_preferred; \
uint32_t reserved; \
struct in6_addr in6_addr; \
}
@@ -131,6 +131,10 @@ struct sd_radv_prefix {
LIST_FIELDS(struct sd_radv_prefix, prefix);
+ /* These are timespans, NOT points in time. */
+ usec_t lifetime_valid_usec;
+ usec_t lifetime_preferred_usec;
+ /* These are points in time specified with clock_boottime_or_monotonic(), NOT timespans. */
usec_t valid_until;
usec_t preferred_until;
};
@@ -155,6 +159,11 @@ struct sd_radv_route_prefix {
struct radv_route_prefix_opt opt;
LIST_FIELDS(struct sd_radv_route_prefix, prefix);
+
+ /* This is a timespan, NOT a point in time. */
+ usec_t lifetime_usec;
+ /* This is a point in time specified with clock_boottime_or_monotonic(), NOT a timespan. */
+ usec_t valid_until;
};
#define log_radv_errno(radv, error, fmt, ...) \