From e1774086a7e535c52f64f2a4431943d9dd9d96a4 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 7 Feb 2022 21:04:50 +0900 Subject: sd-dhcp6-client: add log about Information Refresh Time And store IRT only when the client is running in information requesting mode. --- src/libsystemd-network/sd-dhcp6-lease.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/libsystemd-network/sd-dhcp6-lease.c') 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; } -- cgit v1.2.3