discover: Reject ADD_URL actions without configured network
[petitboot] / discover / device-handler.c
index 2164b223b180f6b67176c5b656b1b9f34e42c299..120f11f52aa819639ece6a1bffaa49d0772921ae 100644 (file)
@@ -923,6 +923,12 @@ void device_handler_process_url(struct device_handler *handler,
        status->detail = talloc_asprintf(status,
                        _("Received config URL %s"), url);
 
        status->detail = talloc_asprintf(status,
                        _("Received config URL %s"), url);
 
+       if (!handler->network) {
+               status->message = talloc_asprintf(handler,
+                                       _("No network configured"));
+               goto msg;
+       }
+
        event = talloc(handler, struct event);
        event->type = EVENT_TYPE_USER;
        event->action = EVENT_ACTION_CONF;
        event = talloc(handler, struct event);
        event->type = EVENT_TYPE_USER;
        event->action = EVENT_ACTION_CONF;