summaryrefslogtreecommitdiffstats
path: root/src/libsystemd-network/sd-dhcp6-lease.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-02-07 13:04:50 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-02-14 07:01:02 +0100
commite1774086a7e535c52f64f2a4431943d9dd9d96a4 (patch)
tree2a15339462adebedd13c74e18da460929ad5f216 /src/libsystemd-network/sd-dhcp6-lease.c
parentsd-dhcp6-client: use memcmp_nn() at one more place (diff)
downloadsystemd-e1774086a7e535c52f64f2a4431943d9dd9d96a4.tar.xz
systemd-e1774086a7e535c52f64f2a4431943d9dd9d96a4.zip
sd-dhcp6-client: add log about Information Refresh Time
And store IRT only when the client is running in information requesting mode.
Diffstat (limited to 'src/libsystemd-network/sd-dhcp6-lease.c')
-rw-r--r--src/libsystemd-network/sd-dhcp6-lease.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libsystemd-network/sd-dhcp6-lease.c b/src/libsystemd-network/sd-dhcp6-lease.c
index 5617e85212..8b8c2312ea 100644
--- a/src/libsystemd-network/sd-dhcp6-lease.c
+++ b/src/libsystemd-network/sd-dhcp6-lease.c
@@ -630,7 +630,12 @@ static int dhcp6_lease_parse_message(
"The client ID in %s message does not match. Ignoring.",
dhcp6_message_type_to_string(message->type));
- if (client->state != DHCP6_STATE_INFORMATION_REQUEST) {
+ if (client->state == DHCP6_STATE_INFORMATION_REQUEST) {
+ client->information_refresh_time_usec = MAX(irt, IRT_MINIMUM);
+ log_dhcp6_client(client, "New information request will be refused in %s.",
+ FORMAT_TIMESPAN(client->information_refresh_time_usec, USEC_PER_SEC));
+
+ } else {
r = dhcp6_lease_get_serverid(lease, NULL, NULL);
if (r < 0)
return log_dhcp6_client_errno(client, r, "%s has no server id",
@@ -643,8 +648,6 @@ static int dhcp6_lease_parse_message(
dhcp6_lease_set_lifetime(lease);
}
- client->information_refresh_time_usec = MAX(irt, IRT_MINIMUM);
-
return 0;
}