[PATCH 1/2] discover: Reject ADD_URL actions without configured network

Samuel Mendoza-Jonas sam.mj at au1.ibm.com
Fri Aug 29 14:03:16 EST 2014


Signed-off-by: Samuel Mendoza-Jonas <sam.mj at au1.ibm.com>
---
 discover/device-handler.c | 6 ++++++
 po/en.po                  | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/discover/device-handler.c b/discover/device-handler.c
index 2164b22..120f11f 100644
--- a/discover/device-handler.c
+++ b/discover/device-handler.c
@@ -923,6 +923,12 @@ void device_handler_process_url(struct device_handler *handler,
 	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;
diff --git a/po/en.po b/po/en.po
index edcbe7a..691722d 100644
--- a/po/en.po
+++ b/po/en.po
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: petitboot 20140623-g89bd2ed2-dirty\n"
 "Report-Msgid-Bugs-To: Geoff Levand <geoff at infradead.org>\n"
-"POT-Creation-Date: 2014-08-22 11:12+1000\n"
+"POT-Creation-Date: 2014-08-29 13:24+1000\n"
 "PO-Revision-Date: 2014-06-24 13:56+0800\n"
 "Last-Translator: Jeremy Kerr <jk at ozlabs.org>\n"
 "Language-Team: English\n"
@@ -63,6 +63,9 @@ msgstr "Default boot cancelled"
 msgid "Received config URL %s"
 msgstr "Received config URL %s"
 
+msgid "No network configured"
+msgstr "No network configured"
+
 msgid "Invalid config URL!"
 msgstr "Invalid config URL!"
 
-- 
1.9.3



More information about the Petitboot mailing list