Lines Matching refs:lease
117 sd_dhcp_lease *lease; member
685 *ret = client->lease; in sd_dhcp_client_get_lease()
733 client->lease = sd_dhcp_lease_unref(client->lease); in client_initialize()
1137 4, &client->lease->server_address); in client_send_request()
1143 4, &client->lease->address); in client_send_request()
1174 request->dhcp.ciaddr = client->lease->address; in client_send_request()
1197 client->lease->server_address, in client_send_request()
1500 if (client->lease) in client_timeout_t1()
1510 _cleanup_(sd_dhcp_lease_unrefp) sd_dhcp_lease *lease = NULL; in client_handle_offer()
1513 r = dhcp_lease_new(&lease); in client_handle_offer()
1518 r = dhcp_lease_set_client_id(lease, in client_handle_offer()
1525 r = dhcp_option_parse(offer, len, dhcp_lease_parse_options, lease, NULL); in client_handle_offer()
1531 lease->next_server = offer->siaddr; in client_handle_offer()
1532 lease->address = offer->yiaddr; in client_handle_offer()
1534 if (lease->lifetime == 0 && client->fallback_lease_lifetime > 0) in client_handle_offer()
1535 lease->lifetime = client->fallback_lease_lifetime; in client_handle_offer()
1537 if (lease->address == 0 || in client_handle_offer()
1538 lease->server_address == 0 || in client_handle_offer()
1539 lease->lifetime == 0) { in client_handle_offer()
1544 if (!lease->have_subnet_mask) { in client_handle_offer()
1545 r = dhcp_lease_set_default_subnet_mask(lease); in client_handle_offer()
1554 sd_dhcp_lease_unref(client->lease); in client_handle_offer()
1555 client->lease = TAKE_PTR(lease); in client_handle_offer()
1603 _cleanup_(sd_dhcp_lease_unrefp) sd_dhcp_lease *lease = NULL; in client_handle_ack()
1607 r = dhcp_lease_new(&lease); in client_handle_ack()
1612 r = dhcp_lease_set_client_id(lease, in client_handle_ack()
1619 r = dhcp_option_parse(ack, len, dhcp_lease_parse_options, lease, &error_message); in client_handle_ack()
1630 lease->next_server = ack->siaddr; in client_handle_ack()
1632 lease->address = ack->yiaddr; in client_handle_ack()
1634 if (lease->address == INADDR_ANY || in client_handle_ack()
1635 lease->server_address == INADDR_ANY || in client_handle_ack()
1636 lease->lifetime == 0) { in client_handle_ack()
1642 if (lease->subnet_mask == INADDR_ANY) { in client_handle_ack()
1643 r = dhcp_lease_set_default_subnet_mask(lease); in client_handle_ack()
1653 if (client->lease) { in client_handle_ack()
1654 if (lease_equal(client->lease, lease)) in client_handle_ack()
1659 client->lease = sd_dhcp_lease_unref(client->lease); in client_handle_ack()
1662 client->lease = TAKE_PTR(lease); in client_handle_ack()
1675 assert(client->lease); in client_set_lease_timeouts()
1676 assert(client->lease->lifetime); in client_set_lease_timeouts()
1679 if (client->lease->lifetime == 0xffffffff) { in client_set_lease_timeouts()
1693 if (client->lease->t2 == 0 || client->lease->t2 >= client->lease->lifetime) in client_set_lease_timeouts()
1694 client->lease->t2 = T2_DEFAULT(client->lease->lifetime); in client_set_lease_timeouts()
1696 if (client->lease->t1 == 0 || client->lease->t1 >= client->lease->t2) in client_set_lease_timeouts()
1697 client->lease->t1 = T1_DEFAULT(client->lease->lifetime); in client_set_lease_timeouts()
1701 if (client->lease->t1 >= client->lease->t2) in client_set_lease_timeouts()
1702 client->lease->t2 = T2_DEFAULT(client->lease->lifetime); in client_set_lease_timeouts()
1704 client->expire_time = client->request_sent + client->lease->lifetime * USEC_PER_SEC; in client_set_lease_timeouts()
1705 client->t1_time = client->request_sent + client->lease->t1 * USEC_PER_SEC; in client_set_lease_timeouts()
1706 client->t2_time = client->request_sent + client->lease->t2 * USEC_PER_SEC; in client_set_lease_timeouts()
1835 client->last_addr = client->lease->address; in client_handle_message()
1843 …r = dhcp_network_bind_udp_socket(client->ifindex, client->lease->address, client->port, client->ip… in client_handle_message()
2047 if (!client->lease) in sd_dhcp_client_send_renew()
2093 assert_return(client->lease, -EUNATCH); in sd_dhcp_client_send_release()
2104 release->dhcp.ciaddr = client->lease->address; in sd_dhcp_client_send_release()
2113 client->lease->server_address, in sd_dhcp_client_send_release()
2128 assert_return(client->lease, -EUNATCH); in sd_dhcp_client_send_decline()
2138 release->dhcp.ciaddr = client->lease->address; in sd_dhcp_client_send_decline()
2147 client->lease->server_address, in sd_dhcp_client_send_decline()