From 22001cb206c1320aee27f679a63d2171d35e99c5 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 3 Dec 2013 16:48:56 +0000 Subject: [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 --- src/net/ipv6.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/net/ipv6.c') diff --git a/src/net/ipv6.c b/src/net/ipv6.c index b4f33f0..68a0c89 100644 --- a/src/net/ipv6.c +++ b/src/net/ipv6.c @@ -954,7 +954,7 @@ struct sockaddr_converter ipv6_sockaddr_converter __sockaddr_converter = { * @v len Length of buffer * @ret len Length of raw value, or negative error */ -static int parse_ipv6_setting ( struct setting_type *type __unused, +static int parse_ipv6_setting ( const struct setting_type *type __unused, const char *value, void *buf, size_t len ) { struct in6_addr ipv6; int rc; @@ -981,7 +981,7 @@ static int parse_ipv6_setting ( struct setting_type *type __unused, * @v len Length of buffer * @ret len Length of formatted value, or negative error */ -static int format_ipv6_setting ( struct setting_type *type __unused, +static int format_ipv6_setting ( const struct setting_type *type __unused, const void *raw, size_t raw_len, char *buf, size_t len ) { const struct in6_addr *ipv6 = raw; @@ -992,7 +992,7 @@ static int format_ipv6_setting ( struct setting_type *type __unused, } /** An IPv6 address setting type */ -struct setting_type setting_type_ipv6 __setting_type = { +const struct setting_type setting_type_ipv6 __setting_type = { .name = "ipv6", .parse = parse_ipv6_setting, .format = format_ipv6_setting, -- cgit v1.1