• Home
  • Raw
  • Download

Lines Matching refs:mess

87 static void option_put(struct dhcp_packet *mess, unsigned char *end, int opt, int len, unsigned int…
88 static void option_put_string(struct dhcp_packet *mess, unsigned char *end,
95 static unsigned char *option_find(struct dhcp_packet *mess, size_t size, int opt_type, int minsize);
97 static size_t dhcp_packet_size(struct dhcp_packet *mess, struct dhcp_netid *netid,
99 static void clear_packet(struct dhcp_packet *mess, unsigned char *end);
101 struct dhcp_packet *mess,
114 static void do_encap_opts(struct dhcp_opt *opts, int encap, int flag, struct dhcp_packet *mess, uns…
115 static void pxe_misc(struct dhcp_packet *mess, unsigned char *end, unsigned char *uuid);
130 struct dhcp_packet *mess = (struct dhcp_packet *)daemon->dhcp_packet.iov_base; in dhcp_reply() local
131 unsigned char *end = (unsigned char *)(mess + 1); in dhcp_reply()
132 unsigned char *real_end = (unsigned char *)(mess + 1); in dhcp_reply()
158 if (mess->op != BOOTREQUEST || mess->hlen > DHCP_CHADDR_MAX) in dhcp_reply()
161 if (mess->htype == 0 && mess->hlen != 0) in dhcp_reply()
165 if ((opt = option_find(mess, sz, OPTION_MESSAGE_TYPE, 1))) in dhcp_reply()
170 if (*((u32 *)&mess->options) != htonl(DHCP_COOKIE)) in dhcp_reply()
176 if ((opt = option_find(mess, sz, OPTION_MAXMESSAGE, 2))) in dhcp_reply()
187 mess = (struct dhcp_packet *)daemon->dhcp_packet.iov_base; in dhcp_reply()
188 real_end = end = ((unsigned char *)mess) + size; in dhcp_reply()
194 if ((option_find(mess, sz, OPTION_REQUESTED_IP, INADDRSZ) || mess_type == DHCPDISCOVER)) in dhcp_reply()
195 mess->ciaddr.s_addr = 0; in dhcp_reply()
197 if ((opt = option_find(mess, sz, OPTION_AGENT_ID, 1))) in dhcp_reply()
206 unsigned char *last_opt = option_find(mess, sz, OPTION_END, 0); in dhcp_reply()
248 if (subnet_addr.s_addr == 0 && (opt = option_find(mess, sz, OPTION_SUBNET_SELECT, INADDRSZ))) in dhcp_reply()
252 if ((opt = option_find(mess, sz, OPTION_CLIENT_ID, 1))) in dhcp_reply()
259 lease = lease_find_by_client(mess->chaddr, mess->hlen, mess->htype, clid, clid_len); in dhcp_reply()
270 emac = extended_hwaddr(mess->htype, mess->hlen, mess->chaddr, clid_len, clid, &emac_len); in dhcp_reply()
274 if (mac->hwaddr_len == mess->hlen && in dhcp_reply()
275 (mac->hwaddr_type == mess->htype || mac->hwaddr_type == 0) && in dhcp_reply()
276 memcmp_masked(mac->hwaddr, mess->chaddr, mess->hlen, mac->mask)) in dhcp_reply()
289 if (mess->giaddr.s_addr || subnet_addr.s_addr || mess->ciaddr.s_addr) in dhcp_reply()
300 else if (mess->giaddr.s_addr) in dhcp_reply()
302 addr = mess->giaddr; in dhcp_reply()
308 addr = mess->ciaddr; in dhcp_reply()
353 ntohl(mess->xid), daemon->namebuff, inet_ntoa(context_tmp->netmask)); in dhcp_reply()
356 ntohl(mess->xid), daemon->namebuff, inet_ntoa(context_tmp->end)); in dhcp_reply()
360 mess->op = BOOTREPLY; in dhcp_reply()
363 mess->chaddr, mess->hlen, mess->htype, NULL); in dhcp_reply()
380 if (mess->htype == 0 || mess->hlen == 0 || (context->flags & CONTEXT_PROXY)) in dhcp_reply()
386 end = mess->options + 64; /* BOOTP vend area is only 64 bytes */ in dhcp_reply()
401 if (mess->file[0]) in dhcp_reply()
403 memcpy(daemon->dhcp_buff2, mess->file, sizeof(mess->file)); in dhcp_reply()
404 daemon->dhcp_buff2[sizeof(mess->file) + 1] = 0; /* ensure zero term. */ in dhcp_reply()
428 mess->yiaddr = config->addr; in dhcp_reply()
430 (lease->hwaddr_len != mess->hlen || in dhcp_reply()
431 lease->hwaddr_type != mess->htype || in dhcp_reply()
432 memcmp(lease->hwaddr, mess->chaddr, lease->hwaddr_len) != 0)) in dhcp_reply()
437 if (!(lease = lease_find_by_client(mess->chaddr, mess->hlen, mess->htype, NULL, 0)) || in dhcp_reply()
446 if (!address_allocate(context, &mess->yiaddr, mess->chaddr, mess->hlen, netid, now)) in dhcp_reply()
450 mess->yiaddr = lease->addr; in dhcp_reply()
453 if (!message && !(context = narrow_context(context, mess->yiaddr, netid))) in dhcp_reply()
472 (!(lease = lease_allocate(mess->yiaddr)))) in dhcp_reply()
477 logaddr = &mess->yiaddr; in dhcp_reply()
479 lease_set_hwaddr(lease, mess->chaddr, NULL, mess->hlen, mess->htype, 0); in dhcp_reply()
488 clear_packet(mess, end); in dhcp_reply()
489 do_options(context, mess, end, NULL, hostname, get_domain(mess->yiaddr), in dhcp_reply()
494 log_packet("BOOTP", logaddr, mess->chaddr, mess->hlen, iface_name, message, mess->xid); in dhcp_reply()
496 return message ? 0 : dhcp_packet_size(mess, netid, agent_id, real_end); in dhcp_reply()
499 if ((opt = option_find(mess, sz, OPTION_CLIENT_FQDN, 4))) in dhcp_reply()
542 else if ((opt = option_find(mess, sz, OPTION_HOSTNAME, 1))) in dhcp_reply()
558 …my_syslog(MS_DHCP | LOG_INFO, _("%u client provides name: %s"), ntohl(mess->xid), client_hostname); in dhcp_reply()
582 mess->chaddr, mess->hlen, in dhcp_reply()
583 mess->htype, hostname); in dhcp_reply()
609 if (!(opt = option_find(mess, sz, o->opt, 1)) || in dhcp_reply()
653 if ((opt = option_find(mess, sz, OPTION_USER_CLASS, 1))) in dhcp_reply()
677 if ((opt = option_find(mess, sz, mopt, 1))) in dhcp_reply()
691 match_vendor_opts(option_find(mess, sz, OPTION_VENDOR_ID, 1), daemon->dhcp_opts); in dhcp_reply()
695 if (sanitise(option_find(mess, sz, OPTION_VENDOR_ID, 1), daemon->namebuff)) in dhcp_reply()
696 my_syslog(MS_DHCP | LOG_INFO, _("%u Vendor class: %s"), ntohl(mess->xid), daemon->namebuff); in dhcp_reply()
697 if (sanitise(option_find(mess, sz, OPTION_USER_CLASS, 1), daemon->namebuff)) in dhcp_reply()
698 my_syslog(MS_DHCP | LOG_INFO, _("%u User class: %s"), ntohl(mess->xid), daemon->namebuff); in dhcp_reply()
712 (opt = option_find(mess, sz, OPTION_VENDOR_ID, 9)) && in dhcp_reply()
715 if ((opt = option_find(mess, sz, OPTION_PXE_UUID, 17))) in dhcp_reply()
723 (opt = option_find(mess, sz, OPTION_VENDOR_CLASS_OPT, 1)) && in dhcp_reply()
750 clear_packet(mess, end); in dhcp_reply()
752 mess->yiaddr = mess->ciaddr; in dhcp_reply()
753 mess->ciaddr.s_addr = 0; in dhcp_reply()
755 mess->siaddr = service->server; in dhcp_reply()
757 mess->siaddr = context->local; in dhcp_reply()
759 snprintf((char *)mess->file, sizeof(mess->file), "%s.%d", service->basename, layer); in dhcp_reply()
760 option_put(mess, end, OPTION_MESSAGE_TYPE, 1, DHCPACK); in dhcp_reply()
761 option_put(mess, end, OPTION_SERVER_IDENTIFIER, INADDRSZ, htonl(context->local.s_addr)); in dhcp_reply()
762 pxe_misc(mess, end, uuid); in dhcp_reply()
771 do_encap_opts(&opt71, OPTION_VENDOR_CLASS_OPT, DHOPT_VENDOR_MATCH, mess, end, 0); in dhcp_reply()
773 log_packet("PXE", &mess->yiaddr, emac, emac_len, iface_name, (char *)mess->file, mess->xid); in dhcp_reply()
774 return dhcp_packet_size(mess, netid, agent_id, real_end); in dhcp_reply()
777 if ((opt = option_find(mess, sz, OPTION_ARCH, 2))) in dhcp_reply()
787 mess->yiaddr.s_addr = 0; in dhcp_reply()
788 if (mess_type == DHCPDISCOVER || mess->ciaddr.s_addr == 0) in dhcp_reply()
790 mess->ciaddr.s_addr = 0; in dhcp_reply()
791 mess->flags |= htons(0x8000); /* broadcast */ in dhcp_reply()
794 clear_packet(mess, end); in dhcp_reply()
801 mess->siaddr = boot->next_server; in dhcp_reply()
804 strncpy((char *)mess->file, boot->file, sizeof(mess->file)-1); in dhcp_reply()
807 option_put(mess, end, OPTION_MESSAGE_TYPE, 1, in dhcp_reply()
809 option_put(mess, end, OPTION_SERVER_IDENTIFIER, INADDRSZ, htonl(context->local.s_addr)); in dhcp_reply()
810 pxe_misc(mess, end, uuid); in dhcp_reply()
812 …do_encap_opts(pxe_opts(pxearch, netid), OPTION_VENDOR_CLASS_OPT, DHOPT_VENDOR_MATCH, mess, end, 0); in dhcp_reply()
814 …log_packet("PXE", NULL, emac, emac_len, iface_name, ignore ? "proxy" : "proxy-ignored", mess->xid); in dhcp_reply()
815 return ignore ? 0 : dhcp_packet_size(mess, netid, agent_id, real_end); in dhcp_reply()
824 if ((opt = option_find(mess, sz, OPTION_REQUESTED_OPTIONS, 0))) in dhcp_reply()
834 if (!(opt = option_find(mess, sz, OPTION_SERVER_IDENTIFIER, INADDRSZ)) || in dhcp_reply()
839 sanitise(option_find(mess, sz, OPTION_MESSAGE, 1), daemon->dhcp_buff); in dhcp_reply()
841 if (!(opt = option_find(mess, sz, OPTION_REQUESTED_IP, INADDRSZ))) in dhcp_reply()
844 …acket("DHCPDECLINE", option_ptr(opt, 0), emac, emac_len, iface_name, daemon->dhcp_buff, mess->xid); in dhcp_reply()
866 if (!(context = narrow_context(context, mess->ciaddr, netid)) || in dhcp_reply()
867 !(opt = option_find(mess, sz, OPTION_SERVER_IDENTIFIER, INADDRSZ)) || in dhcp_reply()
871 if (lease && lease->addr.s_addr == mess->ciaddr.s_addr) in dhcp_reply()
876 log_packet("DHCPRELEASE", &mess->ciaddr, emac, emac_len, iface_name, message, mess->xid); in dhcp_reply()
892 if ((opt = option_find(mess, sz, OPTION_REQUESTED_IP, INADDRSZ))) in dhcp_reply()
926 mess->yiaddr = conf; in dhcp_reply()
930 mess->yiaddr = lease->addr; in dhcp_reply()
933 mess->yiaddr = addr; in dhcp_reply()
936 else if (!address_allocate(context, &mess->yiaddr, emac, emac_len, netid, now)) in dhcp_reply()
940 …("DHCPDISCOVER", opt ? option_ptr(opt, 0) : NULL, emac, emac_len, iface_name, message, mess->xid); in dhcp_reply()
942 if (message || !(context = narrow_context(context, mess->yiaddr, netid))) in dhcp_reply()
945 log_packet("DHCPOFFER" , &mess->yiaddr, emac, emac_len, iface_name, NULL, mess->xid); in dhcp_reply()
953 time = calc_time(context, config, option_find(mess, sz, OPTION_LEASE_TIME, 4)); in dhcp_reply()
954 clear_packet(mess, end); in dhcp_reply()
955 option_put(mess, end, OPTION_MESSAGE_TYPE, 1, DHCPOFFER); in dhcp_reply()
956 …option_put(mess, end, OPTION_SERVER_IDENTIFIER, INADDRSZ, ntohl(server_id(context, override, fallb… in dhcp_reply()
957 option_put(mess, end, OPTION_LEASE_TIME, 4, time); in dhcp_reply()
961 option_put(mess, end, OPTION_T1, 4, (time/2)); in dhcp_reply()
962 option_put(mess, end, OPTION_T2, 4, (time*7)/8); in dhcp_reply()
964 do_options(context, mess, end, req_options, offer_hostname, get_domain(mess->yiaddr), in dhcp_reply()
967 return dhcp_packet_size(mess, netid, agent_id, real_end); in dhcp_reply()
972 if ((opt = option_find(mess, sz, OPTION_REQUESTED_IP, INADDRSZ))) in dhcp_reply()
975 mess->yiaddr = option_addr(opt); in dhcp_reply()
980 if ((opt = option_find(mess, sz, OPTION_SERVER_IDENTIFIER, INADDRSZ))) in dhcp_reply()
1008 if (lease && lease->addr.s_addr != mess->yiaddr.s_addr) in dhcp_reply()
1020 if (lease && lease->addr.s_addr != mess->yiaddr.s_addr) in dhcp_reply()
1036 if ((lease && mess->ciaddr.s_addr != lease->addr.s_addr) || in dhcp_reply()
1045 mess->yiaddr = mess->ciaddr; in dhcp_reply()
1048 log_packet("DHCPREQUEST", &mess->yiaddr, emac, emac_len, iface_name, NULL, mess->xid); in dhcp_reply()
1060 if (!(context = narrow_context(context, mess->yiaddr, netid))) in dhcp_reply()
1069 else if (!address_available(context, mess->yiaddr, netid) && in dhcp_reply()
1070 (!have_config(config, CONFIG_ADDR) || config->addr.s_addr != mess->yiaddr.s_addr)) in dhcp_reply()
1080 config->addr.s_addr != mess->yiaddr.s_addr && in dhcp_reply()
1085 …else if ((addr_config = config_find_by_address(daemon->dhcp_conf, mess->yiaddr)) && addr_config !=… in dhcp_reply()
1088 else if (!lease && (ltmp = lease_find_by_addr(mess->yiaddr))) in dhcp_reply()
1110 if ((lease = lease_allocate(mess->yiaddr))) in dhcp_reply()
1120 log_packet("DHCPNAK", &mess->yiaddr, emac, emac_len, iface_name, message, mess->xid); in dhcp_reply()
1122 mess->yiaddr.s_addr = 0; in dhcp_reply()
1123 clear_packet(mess, end); in dhcp_reply()
1124 option_put(mess, end, OPTION_MESSAGE_TYPE, 1, DHCPNAK); in dhcp_reply()
1125 …option_put(mess, end, OPTION_SERVER_IDENTIFIER, INADDRSZ, ntohl(server_id(context, override, fallb… in dhcp_reply()
1126 option_put_string(mess, end, OPTION_MESSAGE, message, borken_opt); in dhcp_reply()
1129 if (!unicast_dest || mess->giaddr.s_addr != 0 || in dhcp_reply()
1130 mess->ciaddr.s_addr == 0 || is_same_net(context->local, mess->ciaddr, context->netmask)) in dhcp_reply()
1132 mess->flags |= htons(0x8000); /* broadcast */ in dhcp_reply()
1133 mess->ciaddr.s_addr = 0; in dhcp_reply()
1140 if (mess->giaddr.s_addr) in dhcp_reply()
1141 lease->giaddr = mess->giaddr; in dhcp_reply()
1145 if ((opt = option_find(mess, sz, OPTION_USER_CLASS, 1))) in dhcp_reply()
1160 if ((opt = option_find(mess, sz, OPTION_VENDOR_ID, 1))) in dhcp_reply()
1172 if ((opt = option_find(mess, sz, OPTION_HOSTNAME, 1))) in dhcp_reply()
1186 if (!hostname_auth && (client_hostname = host_from_dns(mess->yiaddr))) in dhcp_reply()
1198 time = calc_time(context, config, option_find(mess, sz, OPTION_LEASE_TIME, 4)); in dhcp_reply()
1199 lease_set_hwaddr(lease, mess->chaddr, clid, mess->hlen, mess->htype, clid_len); in dhcp_reply()
1221 log_packet("DHCPACK", &mess->yiaddr, emac, emac_len, iface_name, hostname, mess->xid); in dhcp_reply()
1223 clear_packet(mess, end); in dhcp_reply()
1224 option_put(mess, end, OPTION_MESSAGE_TYPE, 1, DHCPACK); in dhcp_reply()
1225 …option_put(mess, end, OPTION_SERVER_IDENTIFIER, INADDRSZ, ntohl(server_id(context, override, fallb… in dhcp_reply()
1226 option_put(mess, end, OPTION_LEASE_TIME, 4, time); in dhcp_reply()
1231 option_put(mess, end, OPTION_T1, 4, (time/2) - fuzz); in dhcp_reply()
1232 option_put(mess, end, OPTION_T2, 4, ((time/8)*7) - fuzz); in dhcp_reply()
1234 do_options(context, mess, end, req_options, hostname, get_domain(mess->yiaddr), in dhcp_reply()
1238 return dhcp_packet_size(mess, netid, agent_id, real_end); in dhcp_reply()
1244 log_packet("DHCPINFORM", &mess->ciaddr, emac, emac_len, iface_name, message, mess->xid); in dhcp_reply()
1246 if (message || mess->ciaddr.s_addr == 0) in dhcp_reply()
1250 context = narrow_context(context, mess->ciaddr, netid); in dhcp_reply()
1255 (lease = lease_find_by_addr(mess->ciaddr)) && in dhcp_reply()
1260 hostname = host_from_dns(mess->ciaddr); in dhcp_reply()
1262 log_packet("DHCPACK", &mess->ciaddr, emac, emac_len, iface_name, hostname, mess->xid); in dhcp_reply()
1278 clear_packet(mess, end); in dhcp_reply()
1279 option_put(mess, end, OPTION_MESSAGE_TYPE, 1, DHCPACK); in dhcp_reply()
1280 …option_put(mess, end, OPTION_SERVER_IDENTIFIER, INADDRSZ, ntohl(server_id(context, override, fallb… in dhcp_reply()
1288 option_put(mess, end, OPTION_LEASE_TIME, 4, time); in dhcp_reply()
1292 do_options(context, mess, end, req_options, hostname, get_domain(mess->ciaddr), in dhcp_reply()
1296 return dhcp_packet_size(mess, netid, agent_id, real_end); in dhcp_reply()
1473 static unsigned char *option_find(struct dhcp_packet *mess, size_t size, int opt_type, int minsize) in option_find() argument
1478 …if ((ret = option_find1(&mess->options[0] + sizeof(u32), ((unsigned char *)mess) + size, opt_type,… in option_find()
1482 …if (!(overload = option_find1(&mess->options[0] + sizeof(u32), ((unsigned char *)mess) + size, OPT… in option_find()
1487 (ret = option_find1(&mess->file[0], &mess->file[128], opt_type, minsize))) in option_find()
1492 (ret = option_find1(&mess->sname[0], &mess->sname[64], opt_type, minsize))) in option_find()
1535 static unsigned char *find_overload(struct dhcp_packet *mess) in find_overload() argument
1537 unsigned char *p = &mess->options[0] + sizeof(u32); in find_overload()
1548 static size_t dhcp_packet_size(struct dhcp_packet *mess, struct dhcp_netid *netid, in dhcp_packet_size() argument
1551 unsigned char *p = dhcp_skip_opts(&mess->options[0] + sizeof(u32)); in dhcp_packet_size()
1583 my_syslog(MS_DHCP | LOG_INFO, _("%u tags: %s"), ntohl(mess->xid), s); in dhcp_packet_size()
1587 overload = find_overload(mess); in dhcp_packet_size()
1591 *dhcp_skip_opts(mess->file) = OPTION_END; in dhcp_packet_size()
1593 log_options(mess->file, mess->xid); in dhcp_packet_size()
1595 else if ((daemon->options & OPT_LOG_OPTS) && strlen((char *)mess->file) != 0) in dhcp_packet_size()
1596 my_syslog(MS_DHCP | LOG_INFO, _("%u bootfile name: %s"), ntohl(mess->xid), (char *)mess->file); in dhcp_packet_size()
1600 *dhcp_skip_opts(mess->sname) = OPTION_END; in dhcp_packet_size()
1602 log_options(mess->sname, mess->xid); in dhcp_packet_size()
1604 else if ((daemon->options & OPT_LOG_OPTS) && strlen((char *)mess->sname) != 0) in dhcp_packet_size()
1605 my_syslog(MS_DHCP | LOG_INFO, _("%u server name: %s"), ntohl(mess->xid), (char *)mess->sname); in dhcp_packet_size()
1612 if (mess->siaddr.s_addr != 0) in dhcp_packet_size()
1613 my_syslog(MS_DHCP | LOG_INFO, _("%u next server: %s"), ntohl(mess->xid), inet_ntoa(mess->siaddr)); in dhcp_packet_size()
1615 log_options(&mess->options[0] + sizeof(u32), mess->xid); in dhcp_packet_size()
1620 mess->flags |= htons(0x8000); /* force broadcast */ in dhcp_packet_size()
1622 ret = (size_t)(p - (unsigned char *)mess); in dhcp_packet_size()
1630 static unsigned char *free_space(struct dhcp_packet *mess, unsigned char *end, int opt, int len) in free_space() argument
1632 unsigned char *p = dhcp_skip_opts(&mess->options[0] + sizeof(u32)); in free_space()
1639 if (!(overload = find_overload(mess)) && in free_space()
1640 (mess->file[0] == 0 || mess->sname[0] == 0)) in free_space()
1654 if (mess->file[0] == 0) in free_space()
1659 p = dhcp_skip_opts(mess->file); in free_space()
1660 if (p + len + 3 >= mess->file + sizeof(mess->file)) in free_space()
1667 if (mess->sname[0] == 0) in free_space()
1672 p = dhcp_skip_opts(mess->sname); in free_space()
1673 if (p + len + 3 >= mess->sname + sizeof(mess->file)) in free_space()
1692 static void option_put(struct dhcp_packet *mess, unsigned char *end, int opt, int len, unsigned int… in option_put() argument
1695 unsigned char *p = free_space(mess, end, opt, len); in option_put()
1702 static void option_put_string(struct dhcp_packet *mess, unsigned char *end, int opt, in option_put_string() argument
1711 if ((p = free_space(mess, end, opt, len))) in option_put_string()
1794 struct dhcp_packet *mess, unsigned char *end, int null_term) in do_encap_opts() argument
1809 p = free_space(mess, end, encap, enc_len); in do_encap_opts()
1824 (p = free_space(mess, end, encap, enc_len + 1))) in do_encap_opts()
1838 static void pxe_misc(struct dhcp_packet *mess, unsigned char *end, unsigned char *uuid) in pxe_misc() argument
1842 option_put_string(mess, end, OPTION_VENDOR_ID, "PXEClient", 0); in pxe_misc()
1843 if (uuid && (p = free_space(mess, end, OPTION_PXE_UUID, 17))) in pxe_misc()
1989 static void clear_packet(struct dhcp_packet *mess, unsigned char *end) in clear_packet() argument
1991 memset(mess->sname, 0, sizeof(mess->sname)); in clear_packet()
1992 memset(mess->file, 0, sizeof(mess->file)); in clear_packet()
1993 memset(&mess->options[0] + sizeof(u32), 0, end - (&mess->options[0] + sizeof(u32))); in clear_packet()
1994 mess->siaddr.s_addr = 0; in clear_packet()
2015 struct dhcp_packet *mess, in do_options() argument
2052 … my_syslog(MS_DHCP | LOG_INFO, _("%u requested options: %s"), ntohl(mess->xid), daemon->namebuff); in do_options()
2058 mess->siaddr = context->local; in do_options()
2073 option_put_string(mess, end, OPTION_SNAME, boot->sname, 1); in do_options()
2075 strncpy((char *)mess->sname, boot->sname, sizeof(mess->sname)-1); in do_options()
2083 option_put_string(mess, end, OPTION_FILENAME, boot->file, 1); in do_options()
2085 strncpy((char *)mess->file, boot->file, sizeof(mess->file)-1); in do_options()
2089 mess->siaddr = boot->next_server; in do_options()
2097 if ((!req_options || !in_list(req_options, OPTION_FILENAME)) && mess->file[0] == 0 && in do_options()
2100 strncpy((char *)mess->file, (char *)opt->val, sizeof(mess->file)-1); in do_options()
2107 strncpy((char *)mess->sname, (char *)opt->val, sizeof(mess->sname)-1); in do_options()
2112 mess->siaddr.s_addr = ((struct in_addr *)opt->val)->s_addr; in do_options()
2121 f0 = mess->file[0]; in do_options()
2122 mess->file[0] = 1; in do_options()
2123 s0 = mess->sname[0]; in do_options()
2124 mess->sname[0] = 1; in do_options()
2129 if (mess->file[0] == 0 || mess->sname[0] == 0) in do_options()
2134 option_put(mess, end, OPTION_SUBNET_SELECT, INADDRSZ, ntohl(subnet_addr.s_addr)); in do_options()
2140 option_put(mess, end, OPTION_NETMASK, INADDRSZ, ntohl(context->netmask.s_addr)); in do_options()
2146 option_put(mess, end, OPTION_BROADCAST, INADDRSZ, ntohl(context->broadcast.s_addr)); in do_options()
2153 option_put(mess, end, OPTION_ROUTER, INADDRSZ, ntohl(context->router.s_addr)); in do_options()
2157 option_put(mess, end, OPTION_DNSSERVER, INADDRSZ, ntohl(context->local.s_addr)); in do_options()
2162 option_put_string(mess, end, OPTION_DOMAINNAME, domain, null_term); in do_options()
2169 option_put_string(mess, end, OPTION_HOSTNAME, hostname, null_term); in do_options()
2183 if ((p = free_space(mess, end, OPTION_CLIENT_FQDN, len))) in do_options()
2259 if ((p = free_space(mess, end, optno, len))) in do_options()
2300 do_encap_opts(config_opts, opt->u.encap, DHOPT_ENCAP_MATCH, mess, end, null_term); in do_options()
2310 pxe_misc(mess, end, uuid); in do_options()
2315 do_encap_opts(config_opts, OPTION_VENDOR_CLASS_OPT, DHOPT_VENDOR_MATCH, mess, end, null_term); in do_options()
2320 mess->file[0] = f0; in do_options()
2321 mess->sname[0] = s0; in do_options()