From: Yu Watanabe Date: Mon, 7 Feb 2022 12:04:50 +0000 (+0900) Subject: sd-dhcp6-client: add log about Information Refresh Time X-Git-Tag: v251-rc1~291^2~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e1774086a7e535c52f64f2a4431943d9dd9d96a4;p=thirdparty%2Fsystemd.git sd-dhcp6-client: add log about Information Refresh Time And store IRT only when the client is running in information requesting mode. --- diff --git a/src/libsystemd-network/sd-dhcp6-lease.c b/src/libsystemd-network/sd-dhcp6-lease.c index 5617e85212f..8b8c2312ea1 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; }