diff --git a/src/app/config/config.c b/src/app/config/config.c index 337ae93575917aca7ba007ec0300b9436199b6f4..be243a0d8cbcd89eeb208ca265907e84276e277a 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -844,8 +844,7 @@ static int parse_outbound_addresses(or_options_t *options, int validate_only, static void config_maybe_load_geoip_files_(const or_options_t *options, const or_options_t *old_options); static int options_validate_cb(void *old_options, void *options, - void *default_options, - int from_setconf, char **msg); + char **msg); static void cleanup_protocol_warning_severity_level(void); static void set_protocol_warning_severity_level(int warning_severity); static void options_clear_cb(const config_mgr_t *mgr, void *opts); @@ -3231,12 +3230,10 @@ compute_publishserverdescriptor(or_options_t *options) #define RECOMMENDED_MIN_CIRCUIT_BUILD_TIMEOUT (10) static int -options_validate_cb(void *old_options, void *options, void *default_options, - int from_setconf, char **msg) +options_validate_cb(void *old_options, void *options, char **msg) { in_option_validation = 1; - int rv = options_validate(old_options, options, default_options, - from_setconf, msg); + int rv = options_validate(old_options, options, NULL, 0, msg); in_option_validation = 0; return rv; } diff --git a/src/app/config/statefile.c b/src/app/config/statefile.c index 552bd2c4438dbf20ece680f02bd5001723b9aa48..3653deeee10831de9a556ac9ad5d886e4667c440 100644 --- a/src/app/config/statefile.c +++ b/src/app/config/statefile.c @@ -141,9 +141,8 @@ static const config_var_t state_vars_[] = { static int or_state_validate(or_state_t *state, char **msg); -static int or_state_validate_cb(void *old_options, void *options, - void *default_options, - int from_setconf, char **msg); +static int or_state_validate_cb(void *old_options, + void *options, char **msg); /** Magic value for or_state_t. */ #define OR_STATE_MAGIC 0x57A73f57 @@ -269,13 +268,10 @@ validate_transports_in_state(or_state_t *state) } static int -or_state_validate_cb(void *old_state, void *state, void *default_state, - int from_setconf, char **msg) +or_state_validate_cb(void *old_state, void *state, char **msg) { /* We don't use these; only options do. Still, we need to match that * signature. */ - (void) from_setconf; - (void) default_state; (void) old_state; return or_state_validate(state, msg); diff --git a/src/feature/dirauth/shared_random_state.c b/src/feature/dirauth/shared_random_state.c index 474dcb2711c3430667dbcf69c758e6c37fbab5cb..beeb03448c26d30bff9320f9abe3c84181a10f96 100644 --- a/src/feature/dirauth/shared_random_state.c +++ b/src/feature/dirauth/shared_random_state.c @@ -60,8 +60,7 @@ DUMMY_TYPECHECK_INSTANCE(sr_disk_state_t); #define SR_DISK_STATE_MAGIC 0x98AB1254 static int -disk_state_validate_cb(void *old_state, void *state, void *default_state, - int from_setconf, char **msg); +disk_state_validate_cb(void *old_state, void *state, char **msg); /** Array of variables that are saved to disk as a persistent state. */ static const config_var_t state_vars[] = { @@ -345,12 +344,9 @@ disk_state_validate(const sr_disk_state_t *state) /** Validate the disk state (NOP for now). */ static int -disk_state_validate_cb(void *old_state, void *state, void *default_state, - int from_setconf, char **msg) +disk_state_validate_cb(void *old_state, void *state, char **msg) { /* We don't use these; only options do. */ - (void) from_setconf; - (void) default_state; (void) old_state; /* This is called by config_dump which is just before we are about to diff --git a/src/lib/confmgt/confparse.c b/src/lib/confmgt/confparse.c index 08e562f654ff1366f66d2b655ad2beeb4d28fdc4..323c88a31c52cf0ccfdcb13388c19b2397bdf810 100644 --- a/src/lib/confmgt/confparse.c +++ b/src/lib/confmgt/confparse.c @@ -1166,7 +1166,7 @@ config_dump(const config_mgr_t *mgr, const void *default_options, /* XXX use a 1 here so we don't add a new log line while dumping */ if (default_options == NULL) { - if (fmt->validate_fn(NULL, defaults_tmp, defaults_tmp, 1, &msg) < 0) { + if (fmt->validate_fn(NULL, defaults_tmp, &msg) < 0) { // LCOV_EXCL_START log_err(LD_BUG, "Failed to validate default config: %s", msg); tor_free(msg); diff --git a/src/lib/confmgt/confparse.h b/src/lib/confmgt/confparse.h index 2332f697908b2dc88c2a1c5c7508f0ecb3c71d7a..628eb8927e31d13fb8fa485b719caf4717210921 100644 --- a/src/lib/confmgt/confparse.h +++ b/src/lib/confmgt/confparse.h @@ -70,8 +70,6 @@ typedef struct config_deprecation_t { */ typedef int (*validate_fn_t)(void *oldval, void *newval, - void *default_val, - int from_setconf, char **msg_out); struct config_mgr_t; diff --git a/src/test/test_confparse.c b/src/test/test_confparse.c index 5f29a22c10b8a0395ca12455e78b631835205c4a..cfdcd34c3a3e90e3f2b39e62b552ad4d42ac8d5d 100644 --- a/src/test/test_confparse.c +++ b/src/test/test_confparse.c @@ -103,12 +103,9 @@ static config_deprecation_t test_deprecation_notes[] = { }; static int -test_validate_cb(void *old_options, void *options, void *default_options, - int from_setconf, char **msg) +test_validate_cb(void *old_options, void *options, char **msg) { (void)old_options; - (void)default_options; - (void)from_setconf; (void)msg; test_struct_t *ts = options;