- return (FALSE);
- }
- if (bcmp(pkt->dp_options, rfc_magic, RFC_MAGIC_SIZE)) {
- if (err)
- sprintf(err, "missing magic number");
- return (FALSE);
- }
- if (dhcpol_parse_buffer(options, pkt->dp_options + RFC_MAGIC_SIZE,
- len - sizeof(*pkt) - RFC_MAGIC_SIZE, err) == FALSE)
- return (FALSE);
- { /* get overloaded options */
- unsigned char * overload;
- int overload_len;
-
- overload = (unsigned char *)
- dhcpol_find(options, dhcptag_option_overload_e,
- &overload_len, NULL);
- if (overload && overload_len == 1) { /* has overloaded options */
- dhcpol_t extra;
-
- dhcpol_init(&extra);
- if (*overload == DHCP_OVERLOAD_FILE
- || *overload == DHCP_OVERLOAD_BOTH) {
- if (dhcpol_parse_buffer(&extra, pkt->dp_file,
- sizeof(pkt->dp_file), NULL)) {
- dhcpol_concat(options, &extra);
- dhcpol_free(&extra);
- }
- }
- if (*overload == DHCP_OVERLOAD_SNAME
- || *overload == DHCP_OVERLOAD_BOTH) {
- if (dhcpol_parse_buffer(&extra, pkt->dp_sname,
- sizeof(pkt->dp_sname), NULL)) {
- dhcpol_concat(options, &extra);
- dhcpol_free(&extra);
- }
- }
- }
- }
- return (TRUE);
-}
-
-/*
- * Function: dhcpol_parse_vendor
- *
- * Purpose:
- * Given a set of options, find the vendor specific option(s)
- * and parse all of them into a single option list.
- *
- * Return value:
- * TRUE if vendor specific options existed and were parsed succesfully,
- * FALSE otherwise.
- */
-boolean_t
-dhcpol_parse_vendor(dhcpol_t * vendor, dhcpol_t * options,
- unsigned char * err)
-{
- dhcpol_t extra;
- boolean_t ret = FALSE;
- int start = 0;
-
- if (err)
- err[0] = '\0';
-
- dhcpol_init(vendor);
- dhcpol_init(&extra);
-
- for (;;) {
- void * data;
- int len;
-
- data = dhcpol_find(options, dhcptag_vendor_specific_e, &len, &start);
- if (data == NULL) {
- break; /* out of for */