Home | History | Annotate | Download | only in dhcpcd

Lines Matching full:state

228 	free(iface->state->old);
229 iface->state->old = iface->state->new;
230 iface->state->new = NULL;
231 iface->state->reason = reason;
233 free(iface->state->old);
234 iface->state->old = NULL;
235 iface->state->lease.addr.s_addr = 0;
255 if (strcmp(iface->state->reason, "RELEASE") != 0)
278 if (iface->state->options->options & DHCPCD_XID_HWADDR &&
293 struct if_state *state = iface->state;
294 struct if_options *ifo = state->options;
304 iface->name, get_dhcp_op(type), state->xid);
306 if (state->interval == 0)
307 state->interval = 4;
309 state->interval *= 2;
310 if (state->interval > 64)
311 state->interval = 64;
313 tv.tv_sec = state->interval + DHCP_RAND_MIN;
317 iface->name, get_dhcp_op(type), state->xid,
329 (!(ifo->options & DHCPCD_INFORM) && is_bootp(iface->state->new)))
339 to.s_addr = state->lease.server.s_addr;
409 iface->state->interval = 0;
412 iface->state->lease.addr.s_addr = 0;
490 struct if_state *state = iface->state;
491 struct if_options *ifo = state->options;
493 struct dhcp_lease *lease = &state->lease;
499 state->interval = 0;
521 add_timeout_sec(state->nakoff, start_interface, iface);
522 state->nakoff *= 2;
523 if (state->nakoff > NAKOFF_MAX)
524 state->nakoff = NAKOFF_MAX;
543 state->nakoff = 1;
546 state->state == DHS_DISCOVER)
555 free(state->offer);
556 state->offer = dhcp;
559 free(state->old);
560 state->old = state->new;
561 state->new = state->offer;
562 state->offer = NULL;
563 state->reason = "TEST";
602 free(state->offer);
603 state->offer = dhcp;
616 iface->addr.s_addr != state->offer->yiaddr)
620 addr.s_addr = state->offer->yiaddr;
622 state->claims = 0;
623 state->probes = 0;
624 state->conflicts = 0;
625 state->state = DHS_PROBE;
659 i = whitelisted_ip(iface->state->options, from.s_addr);
666 blacklisted_ip(iface->state->options, from.s_addr) == 1)
696 if (iface->state->xid != dhcp->xid) {
699 iface->name, dhcp->xid, iface->state->xid,
725 if (iface->state->new != NULL &&
726 iface->state->new->cookie == htonl(MAGIC_COOKIE))
729 iface->name, inet_ntoa(iface->state->lease.addr));
730 iface->state->xid = dhcp_xid(iface);
750 struct if_state *ifs = iface->state;
840 strlcpy(iface->state->profile, profile,
841 sizeof(iface->state->profile));
845 *iface->state->profile = '\0';
846 free_options(iface->state->options);
847 iface->state->options = ifo;
861 select_profile(iface, iface->state->options->fallback);
869 add_options(iface->state->options, argc, argv);
884 if (!iface || !(iface->state->options->options & DHCPCD_LINK))
904 iface->state->interval = 0;
905 iface->state->reason = "CARRIER";
916 struct if_options *ifo = iface->state->options;
918 iface->state->state = DHS_DISCOVER;
919 iface->state->xid = dhcp_xid(iface);
926 if (IN_LINKLOCAL(htonl(iface->state->fail.s_addr)))
940 iface->state->state = DHS_REQUEST;
950 iface->name, inet_ntoa(iface->state->lease.addr));
951 iface->state->state = DHS_RENEW;
952 iface->state->xid = dhcp_xid(iface);
963 iface->state->state = DHS_REBIND;
965 iface->state->lease.server.s_addr = 0;
975 iface->state->interval = 0;
1004 ifo = iface->state->options;
1014 iface->state->reason = "3RDPARTY";
1027 ifo = iface->state->options;
1028 iface->state->offer =
1041 iface->addr.s_addr = iface->state->options->req_addr.s_addr;
1042 iface->net.s_addr = iface->state->options->req_mask.s_addr;
1044 iface->state->options->options |= DHCPCD_STATIC;
1048 iface->state->state = DHS_INFORM;
1049 iface->state->xid = dhcp_xid(iface);
1056 struct if_options *ifo = iface->state->options;
1066 if (ifo->reboot == 0 || iface->state->offer == NULL) {
1072 iface->name, inet_ntoa(iface->state->lease.addr));
1073 } else if (iface->state->offer->cookie == 0) {
1075 iface->state->claims = 0;
1082 iface->name, inet_ntoa(iface->state->lease.addr));
1084 iface->state->state = DHS_REBOOT;
1085 iface->state->xid = dhcp_xid(iface);
1086 iface->state->lease.server.s_addr = 0;
1091 iface->state->lease.frominfo)
1107 struct if_options *ifo = iface->state->options;
1120 free(iface->state->offer);
1121 iface->state->offer = NULL;
1123 if (iface->state->arping_index < ifo->arping_len) {
1144 nolease = iface->state->offer && options & DHCPCD_TEST;
1146 iface->state->offer = read_lease(iface);
1147 if (iface->state->offer) {
1148 get_lease(&iface->state->lease, iface->state->offer);
1149 iface->state->lease.frominfo = 1;
1150 if (iface->state->offer->cookie == 0) {
1151 if (iface->state->offer->yiaddr ==
1154 free(iface->state->offer);
1155 iface->state->offer = NULL;
1157 } else if (iface->state->lease.leasetime != ~0U &&
1162 if ((time_t)iface->state->lease.leasetime <
1168 free(iface->state->offer);
1169 iface->state->offer = NULL;
1170 iface->state->lease.addr.s_addr = 0;
1173 iface->state->lease.leasetime -= l;
1174 iface->state->lease.renewaltime -= l;
1175 iface->state->lease.rebindtime -= l;
1179 if (iface->state->offer == NULL)
1181 else if (iface->state->offer->cookie == 0 &&
1182 iface->state->options->options & DHCPCD_IPV4LL)
1193 if (iface->state)
1194 ifs = iface->state;
1196 ifs = iface->state = xzalloc(sizeof(*ifs));
1198 ifs->state = DHS_INIT;
1291 ifo = ifp->state->options;
1294 && ifp->state->new != NULL &&
1295 ifp->state->new->cookie == htonl(MAGIC_COOKIE))
1310 ifp->state->interval = 0;
1311 ifp->state->nakoff = 1;
1334 ifo = ifp->state->options;
1341 if (ifp->state->new &&
1342 ifp->state->new->yiaddr == addr->s_addr)
1346 free(ifp->state->old);
1347 ifp->state->old = ifp->state->new;
1348 ifp->state->new = dhcp_message_new(addr, net);
1355 ifp->state->new,
1358 ifp->state->reason = "STATIC";
1362 ifp->state->state = DHS_INFORM;
1363 ifp->state->xid = dhcp_xid(ifp);
1364 ifp->state->lease.server.s_addr =
1388 ifo = iface->state->options;
1391 ifo = iface->state->options;
1392 iface->state->interval = 0;
1400 free(iface->state->offer);
1401 iface->state->offer = NULL;
1444 else if (ifn->state->new)
1515 if (ifp->state->new)
1544 ifp->state->options->options & DHCPCD_RELEASE))
1668 ifp->state->options->options |= DHCPCD_RELEASE;
1669 if (ifp->state->options->options & DHCPCD_RELEASE &&
1692 iface->state->new != NULL &&
1693 (iface->state->new->cookie == htonl(MAGIC_COOKIE) ||
1694 iface->state->options->options & DHCPCD_INFORM))
1862 iface->state = xzalloc(sizeof(*iface->state));
1863 iface->state->options = xzalloc(sizeof(*iface->state->options));
1864 strlcpy(iface->state->options->script, if_options->script,
1865 sizeof(iface->state->options->script));
1866 iface->state->new = read_lease(iface);
1867 if (iface->state->new == NULL && errno == ENOENT) {
1870 iface->state->new = read_lease(iface);
1872 if (iface->state->new == NULL) {
1878 iface->state->reason = "DUMP";