Lines Matching refs:lease
916 const struct dhcp_lease *lease = &iface->state->lease;
924 iface->net.s_addr == lease->net.s_addr &&
931 dhcp->ciaddr = lease->addr.s_addr;
969 if (lease->addr.s_addr && lease->cookie == htonl(MAGIC_COOKIE)) {
972 lease->addr.s_addr != iface->addr.s_addr))
974 PUTADDR(DHO_IPADDRESS, lease->addr);
975 if (lease->server.s_addr)
976 PUTADDR(DHO_SERVERID, lease->server);
980 if (lease->server.s_addr)
981 PUTADDR(DHO_SERVERID, lease->server);
1130 syslog(LOG_DEBUG, "%s: writing lease `%s'",
1136 /* the lease file might have been created when dhcpcd was running as root */
1178 syslog(LOG_DEBUG, "%s: reading lease `%s'",
1464 get_lease(struct dhcp_lease *lease, const struct dhcp_message *dhcp)
1468 lease->cookie = dhcp->cookie;
1471 lease->addr.s_addr = dhcp->yiaddr;
1473 lease->addr.s_addr = dhcp->ciaddr;
1474 if (get_option_addr(&lease->net, dhcp, DHO_SUBNETMASK) == -1)
1475 lease->net.s_addr = get_netmask(lease->addr.s_addr);
1476 if (get_option_addr(&lease->brd, dhcp, DHO_BROADCAST) == -1)
1477 lease->brd.s_addr = lease->addr.s_addr | ~lease->net.s_addr;
1478 if (get_option_uint32(&lease->leasetime, dhcp, DHO_LEASETIME) == 0) {
1479 /* Ensure that we can use the lease */
1481 if (now.tv_sec + (time_t)lease->leasetime < now.tv_sec)
1482 lease->leasetime = ~0U; /* Infinite lease */
1484 lease->leasetime = ~0U; /* Default to infinite lease */
1485 if (get_option_uint32(&lease->renewaltime, dhcp, DHO_RENEWALTIME) != 0)
1486 lease->renewaltime = 0;
1487 if (get_option_uint32(&lease->rebindtime, dhcp, DHO_REBINDTIME) != 0)
1488 lease->rebindtime = 0;
1489 if (get_option_addr(&lease->server, dhcp, DHO_SERVERID) != 0)
1490 lease->server.s_addr = INADDR_ANY;