diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-09-04 12:48:26 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-09-04 12:48:26 -0400 |
commit | 33989cd002c761c37d2ed551f8aae0955dde4cd4 (patch) | |
tree | e3266ac23dd6f8e38a1814473f47cf9a9c2857ed /src | |
parent | 834e1f8085af43c8f7bd07c346cf6f760a519f13 (diff) | |
parent | 651629cbdf5ae1af6702d282516bebc124f8742a (diff) | |
download | tor-33989cd002c761c37d2ed551f8aae0955dde4cd4.tar.gz tor-33989cd002c761c37d2ed551f8aae0955dde4cd4.zip |
Merge remote-tracking branch 'dgoulet/bug23366_032_01'
Diffstat (limited to 'src')
-rw-r--r-- | src/or/config.c | 27 | ||||
-rw-r--r-- | src/test/test_options.c | 2 |
2 files changed, 23 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 diff --git a/src/test/test_options.c b/src/test/test_options.c index 5f35c47f79..92e6982823 100644 --- a/src/test/test_options.c +++ b/src/test/test_options.c @@ -528,6 +528,8 @@ test_options_validate__outbound_addresses(void *ignored) ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg); tt_int_op(ret, OP_EQ, -1); + tt_str_op(msg, OP_EQ, "Multiple outbound bind addresses configured: " + "xxyy!!!sdfaf"); done: free_options_test_data(tdata); |