Home | History | Annotate | Download | only in dhcpcd

Lines Matching defs:dhcp

2  * dhcpcd - DHCP client daemon
97 /* If set, avoid routes after a DHCP success */
311 struct dhcp_message *dhcp;
350 len = make_message(&dhcp, iface, type);
353 from.s_addr = dhcp->ciaddr;
359 r = send_packet(iface, to, (uint8_t *)dhcp, len);
365 len = make_udp_packet(&udp, (uint8_t *)dhcp, len, from, to);
382 free(dhcp);
443 const struct interface *iface, const struct dhcp_message *dhcp,
452 a = get_option_string(dhcp, DHO_MESSAGE);
453 else if (dhcp->yiaddr != 0) {
454 addr.s_addr = dhcp->yiaddr;
460 r = get_option_addr(&addr, dhcp, DHO_SERVERID);
461 if (dhcp->servername[0] && r == 0)
463 tfrom, inet_ntoa(addr), dhcp->servername);
508 struct dhcp_message *dhcp = *dhcpp;
518 if (get_option_uint8(&type, dhcp, DHO_MESSAGETYPE) == -1)
524 get_option_addr(&addr, dhcp, DHO_SERVERID) == -1)
526 log_dhcp(LOG_WARNING, "reject NAK", iface, dhcp, from);
530 log_dhcp(LOG_WARNING, "NAK:", iface, dhcp, from);
547 get_option_uint8(&tmp, dhcp, i) != 0)
553 log_dhcp(LOG_WARNING, "reject DHCP", iface, dhcp, from);
560 (dhcp->ciaddr == INADDR_ANY || dhcp->ciaddr == INADDR_BROADCAST) &&
561 (dhcp->yiaddr == INADDR_ANY || dhcp->yiaddr == INADDR_BROADCAST))
564 iface, dhcp, from);
575 lease->addr.s_addr = dhcp->yiaddr;
576 lease->cookie = dhcp->cookie;
578 get_option_addr(&lease->server, dhcp, DHO_SERVERID) != 0)
580 log_dhcp(LOG_INFO, "offered", iface, dhcp, from);
582 state->offer = dhcp;
599 * It also seems that some MS DHCP servers actually
610 iface, dhcp, from);
617 iface, dhcp, from);
622 log_dhcp(LOG_INFO, "acknowledged", iface, dhcp, from);
629 state->offer = dhcp;
636 /* We now have an offer, so close the DHCP sockets.
637 * This allows us to safely ARP when broken DHCP servers send an ACK
665 struct dhcp_message *dhcp = NULL;
672 * The benefit is that if we get >1 DHCP packet in our buffer and
688 "%s: non whitelisted DHCP packet from %s",
695 "%s: blacklisted DHCP packet from %s",
707 if ((size_t)bytes > sizeof(*dhcp)) {
709 "%s: packet greater than DHCP size from %s",
713 if (!dhcp)
714 dhcp = xzalloc(sizeof(*dhcp));
715 memcpy(dhcp, pp, bytes);
716 if (dhcp->cookie != htonl(MAGIC_COOKIE)) {
722 if (iface->state->xid != dhcp->xid) {
725 iface->name, dhcp->xid, iface->state->xid,
730 if (iface->hwlen <= sizeof(dhcp->chaddr) &&
731 memcmp(dhcp->chaddr, iface->hwaddr, iface->hwlen))
734 iface->name, dhcp->xid,
735 hwaddr_ntoa(dhcp->chaddr, sizeof(dhcp->chaddr)));
738 handle_dhcp(iface, &dhcp, &from);
743 free(dhcp);
1042 struct dhcp_message *dhcp;
1045 dhcp = xzalloc(sizeof(*dhcp));
1046 dhcp->yiaddr = addr->s_addr;
1047 p = dhcp->options;
1055 return dhcp;
1957 /* android runs us as user "dhcp" */
1980 "dhcp.%s.pid", p2p_interface) >= PROPERTY_KEY_MAX)
2067 "dhcp.%s.pid", p2p_interface) >= PROPERTY_KEY_MAX)