summaryrefslogtreecommitdiffstats
path: root/src/net/validator.c
diff options
context:
space:
mode:
authorMichael Brown2013-12-03 17:48:56 +0100
committerMichael Brown2013-12-05 01:37:02 +0100
commit22001cb206c1320aee27f679a63d2171d35e99c5 (patch)
treea972bb914371a68d4925dcc007238dcb836546ba /src/net/validator.c
parent[fbcon] Add support for displaying a cursor (diff)
downloadipxe-22001cb206c1320aee27f679a63d2171d35e99c5.tar.gz
ipxe-22001cb206c1320aee27f679a63d2171d35e99c5.tar.xz
ipxe-22001cb206c1320aee27f679a63d2171d35e99c5.zip
[settings] Explicitly separate the concept of a completed fetched setting
The fetch_setting() family of functions may currently modify the definition of the specified setting (e.g. to add missing type information). Clean up this interface by requiring callers to provide an explicit buffer to contain the completed definition of the fetched setting, if required. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/validator.c')
-rw-r--r--src/net/validator.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/net/validator.c b/src/net/validator.c
index d61cb92f..56eebe3d 100644
--- a/src/net/validator.c
+++ b/src/net/validator.c
@@ -121,7 +121,7 @@ static struct interface_descriptor validator_job_desc =
*/
/** Cross-signed certificate source setting */
-struct setting crosscert_setting __setting ( SETTING_CRYPTO ) = {
+const struct setting crosscert_setting __setting ( SETTING_CRYPTO ) = {
.name = "crosscert",
.description = "Cross-signed certificate source",
.tag = DHCP_EB_CROSS_CERT,
@@ -232,14 +232,7 @@ static int validator_start_download ( struct validator *validator,
int rc;
/* Determine cross-signed certificate source */
- len = fetch_string_setting_copy ( NULL, &crosscert_setting,
- &crosscert_copy );
- if ( len < 0 ) {
- rc = len;
- DBGC ( validator, "VALIDATOR %p could not fetch crosscert "
- "setting: %s\n", validator, strerror ( rc ) );
- goto err_fetch_crosscert;
- }
+ fetch_string_setting_copy ( NULL, &crosscert_setting, &crosscert_copy );
crosscert = ( crosscert_copy ? crosscert_copy : crosscert_default );
/* Allocate URI string */
@@ -279,7 +272,6 @@ static int validator_start_download ( struct validator *validator,
free ( uri_string );
err_alloc_uri_string:
free ( crosscert_copy );
- err_fetch_crosscert:
return rc;
}