]> git.ozlabs.org Git - petitboot/blobdiff - discover/pxe-parser.c
discover/pxe-parser: All options are name <space> value pairs
[petitboot] / discover / pxe-parser.c
index 662716ac075cfe6fe73e6085de986bc08ec1b924..67cb7882f46b77c85da01a8db7faa076773df7d3 100644 (file)
@@ -21,6 +21,9 @@ static void pxe_process_pair(struct conf_context *ctx,
        struct discover_boot_option *opt = ctx->parser_info;
        struct pb_url *url;
 
+       if (!name)
+               return;
+
        if (streq(name, "LABEL")) {
                if (opt)
                        pxe_finish(ctx);
@@ -28,10 +31,9 @@ static void pxe_process_pair(struct conf_context *ctx,
                opt = discover_boot_option_create(ctx->dc, ctx->dc->device);
                ctx->parser_info = opt;
 
-               opt->option->device_id = ctx->dc->device->device->id;
                opt->option->name = talloc_strdup(opt, value);
                opt->option->id = talloc_asprintf(opt, "%s@%p",
-                               opt->option->device_id, opt);
+                               ctx->dc->device->device->id, opt);
                return;
        }