+ info->current++;
+ pxe_load_next_filename(conf);
+ if (info->pxe_conf_files[info->current] == NULL) {
+ /* Nothing left to try */
+ device_handler_status_dev_err(handler,
+ conf->dc->device,
+ _("PXE autoconfiguration failed"));
+ goto out_clean;
+ }
+ return;
+ }
+
+ /*
+ * Parse the first successfully downloaded file. We only want to parse
+ * the first because otherwise we could parse options from both a
+ * machine-specific config and a 'fallback' default config
+ */
+
+ conf_parse_buf(conf, buf, len);
+
+ /* We may be called well after the original caller of iterate_parsers(),
+ * commit any new boot options ourselves */
+ device_handler_discover_context_commit(handler, conf->dc);
+
+ /*
+ * TRANSLATORS: the format specifier in this string is a URL
+ * eg. tftp://192.168.1.1/pxelinux.cfg
+ */
+ device_handler_status_dev_info(handler, conf->dc->device,
+ _("Parsed PXE config from %s"),
+ pb_url_to_string(result->url));
+
+ talloc_free(buf);
+out_clean:
+ if (result && result->cleanup_local)
+ unlink(result->local);
+ talloc_free(conf);
+}
+
+/**
+ * Return a new conf_context and increment the talloc reference count on
+ * the discover_context struct.
+ * @param ctx Parent talloc context
+ * @param orig Original discover_context
+ * @return Pointer to new conf_context
+ */
+static struct conf_context *copy_context(void *ctx, struct discover_context *dc)
+{
+ struct pxe_parser_info *info;
+ struct conf_context *conf;
+
+ conf = talloc_zero(ctx, struct conf_context);