Lines Matching defs:lifetime
807 time_left = (client->lease->lifetime - client->lease->t2) / 2;
1111 lease->lifetime == 0) {
1112 log_dhcp_client(client, "received lease lacks address, server address or lease lifetime, ignoring");
1183 lease->lifetime == 0) {
1185 "address or lease lifetime, ignoring");
1219 static uint64_t client_compute_timeout(sd_dhcp_client *client, uint32_t lifetime, double factor) {
1222 assert(lifetime > 0);
1224 if (lifetime > 3)
1225 lifetime -= 3;
1227 lifetime = 0;
1229 return client->request_sent + (lifetime * USEC_PER_SEC * factor) +
1244 assert(client->lease->lifetime);
1251 if (client->lease->lifetime == 0xffffffff)
1260 lifetime_timeout = client_compute_timeout(client, client->lease->lifetime, 1);
1264 client->lease->t2 < client->lease->lifetime) {
1270 t2_timeout = client_compute_timeout(client, client->lease->lifetime, 7.0 / 8.0);
1271 client->lease->t2 = (client->lease->lifetime * 7) / 8;
1272 t1_timeout = client_compute_timeout(client, client->lease->lifetime, 0.5);
1273 client->lease->t1 = client->lease->lifetime / 2;
1275 } else if (client->lease->t2 > 0 && client->lease->t2 < client->lease->lifetime) {
1278 t1_timeout = client_compute_timeout(client, client->lease->lifetime, 0.5);
1279 client->lease->t1 = client->lease->lifetime / 2;
1282 t2_timeout = client_compute_timeout(client, client->lease->lifetime, 7.0 / 8.0);
1283 client->lease->t2 = (client->lease->lifetime * 7) / 8;
1285 } else if (client->lease->t1 > 0 && client->lease->t1 < client->lease->lifetime) {
1288 t2_timeout = client_compute_timeout(client, client->lease->lifetime, 7.0 / 8.0);
1289 client->lease->t2 = (client->lease->lifetime * 7) / 8;
1292 t2_timeout = client_compute_timeout(client, client->lease->lifetime, 0.5);
1293 client->lease->t2 = client->lease->lifetime / 2;
1297 t1_timeout = client_compute_timeout(client, client->lease->lifetime, 0.5);
1298 client->lease->t1 = client->lease->lifetime / 2;
1299 t2_timeout = client_compute_timeout(client, client->lease->lifetime, 7.0 / 8.0);
1300 client->lease->t2 = (client->lease->lifetime * 7) / 8;
1303 /* arm lifetime timeout */
1316 r = sd_event_source_set_description(client->timeout_expire, "dhcp4-lifetime");