aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-08-31 08:29:09 -0400
committerDavid Goulet <dgoulet@torproject.org>2017-08-31 08:29:09 -0400
commit651629cbdf5ae1af6702d282516bebc124f8742a (patch)
treeea308299ab7ffd7fc15c78c3f61347f5029340db /src/or/config.c
parent209bfe715cc8c1c59b2578c406749a0d4a5bd8cb (diff)
downloadtor-651629cbdf5ae1af6702d282516bebc124f8742a.tar.gz
tor-651629cbdf5ae1af6702d282516bebc124f8742a.zip
config: Make parse_outbound_addresses() return failures
The function was never returning an error code on failure to parse the OutboundAddress* options. In the process, it was making our test_options_validate__outbound_addresses() not test the right thing. Fixes #23366 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 30853724e4..ff70a4465e 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -7921,13 +7921,28 @@ parse_outbound_addresses(or_options_t *options, int validate_only, char **msg)
memset(&options->OutboundBindAddresses, 0,
sizeof(options->OutboundBindAddresses));
}
- parse_outbound_address_lines(options->OutboundBindAddress,
- OUTBOUND_ADDR_EXIT_AND_OR, options, validate_only, msg);
- parse_outbound_address_lines(options->OutboundBindAddressOR,
- OUTBOUND_ADDR_OR, options, validate_only, msg);
- parse_outbound_address_lines(options->OutboundBindAddressExit,
- OUTBOUND_ADDR_EXIT, options, validate_only, msg);
+
+ if (parse_outbound_address_lines(options->OutboundBindAddress,
+ OUTBOUND_ADDR_EXIT_AND_OR, options,
+ validate_only, msg) < 0) {
+ goto err;
+ }
+
+ if (parse_outbound_address_lines(options->OutboundBindAddressOR,
+ OUTBOUND_ADDR_OR, options, validate_only,
+ msg) < 0) {
+ goto err;
+ }
+
+ if (parse_outbound_address_lines(options->OutboundBindAddressExit,
+ OUTBOUND_ADDR_EXIT, options, validate_only,
+ msg) < 0) {
+ goto err;
+ }
+
return 0;
+ err:
+ return -1;
}
/** Load one of the geoip files, <a>family</a> determining which