tor/src/feature/relay
David Goulet 803e769fb2 relay: Remove possible ORPorts duplicate from parsed list
Now that tor automatically binds to IPv4 _and_ IPv6, in order to avoid
breaking configurations, we sanitize the parsed lists for duplicate ORPorts.
It is possible to happen because we still allow this configuration;

  ORPort 9888
  ORPort [4242::1]:9888

Meaning that the first ORPort value will bind to 0.0.0.0:9888 _and_ [::]:9888
which would lead to an error when attempting to bind on [4242::1]:9888.
However, that configuration is accepted today and thus we must not break it.

To remedy, we now sanitize the parsed list and prioritize an ORPort that has
an explicit address over the global one.

A warning is emitted if such configuration pattern is found. This is only for
the ORPort.

Related to #33246

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-21 15:48:05 -04:00
..
.may_include practracker: Add missing .may_include files 2019-12-04 12:15:22 -05:00
circuitbuild_relay.c Collapse channel_get_*_remote_addr() into a single function. 2020-07-16 09:02:10 -04:00
circuitbuild_relay.h Fill in missing IPv6 addresses in extend cells 2020-06-22 15:33:03 -04:00
dns_structs.h Merge branch 'pre_formatter_cleanups_squashed' 2020-01-09 07:32:39 -05:00
dns.c Fix some checks of tor_inet_ntoa() return value 2020-06-05 11:49:24 +03:00
dns.h Make dns_cancel_pending_resolve() STATIC. 2020-02-19 12:30:09 -05:00
ext_orport.c fix typo in log message 2020-03-27 02:51:01 -04:00
ext_orport.h Note module-local functions in ext_orport.h 2020-02-19 12:12:00 -05:00
feature_relay.md Doxygen: rename all .dox files to end with .md 2019-11-15 09:28:12 -05:00
include.am relay: Rename relay_resolve_addr.{c|h} file 2020-05-05 15:34:58 -04:00
onion_queue.c onion_queue.c: use TAILQ_HEAD less confusingly. 2020-02-06 14:33:05 -05:00
onion_queue.h It's 2020. Update the copyright dates with "make update-copyright" 2020-01-08 18:39:17 -05:00
relay_config.c relay: Remove possible ORPorts duplicate from parsed list 2020-07-21 15:48:05 -04:00
relay_config.h Set *have_low_ports_out from stub port_parse_ports_relay(). 2020-03-20 07:56:26 -04:00
relay_find_addr.c relay: Add AddressDisableIPv6 torrc option 2020-07-21 08:18:31 -04:00
relay_find_addr.h relay: Use flags in relay_find_addr_to_publish() 2020-07-20 14:54:13 -04:00
relay_handshake.c Move relay_handshake.[ch] into src/feature/relay, and make it optional 2020-02-20 10:41:06 -05:00
relay_handshake.h Move relay_handshake.[ch] into src/feature/relay, and make it optional 2020-02-20 10:41:06 -05:00
relay_periodic.c addr: Use tor_addr_t instead of uint32_t for IPv4 2020-07-14 10:36:08 -04:00
relay_periodic.h It's 2020. Update the copyright dates with "make update-copyright" 2020-01-08 18:39:17 -05:00
relay_stub.c Add a SUBSYS_DECLARE_LOCATION() to every subsystem. 2020-03-26 11:20:20 -04:00
relay_sys.c Add a SUBSYS_DECLARE_LOCATION() to every subsystem. 2020-03-26 11:20:20 -04:00
relay_sys.h It's 2020. Update the copyright dates with "make update-copyright" 2020-01-08 18:39:17 -05:00
router.c Rename router_get_advertised_*() functions. 2020-07-21 12:59:03 -04:00
router.h Rename router_get_advertised_*() functions. 2020-07-21 12:59:03 -04:00
routerkeys.c It's 2020. Update the copyright dates with "make update-copyright" 2020-01-08 18:39:17 -05:00
routerkeys.h relay: Set some output arguments in stubs 2020-03-21 02:48:40 +10:00
routermode.c It's 2020. Update the copyright dates with "make update-copyright" 2020-01-08 18:39:17 -05:00
routermode.h It's 2020. Update the copyright dates with "make update-copyright" 2020-01-08 18:39:17 -05:00
selftest.c addr: Use tor_addr_t instead of uint32_t for IPv4 2020-07-14 10:36:08 -04:00
selftest.h Refactor reachability test logging: log exactly what we launch. 2020-06-30 11:12:46 -04:00
transport_config.c It's 2020. Update the copyright dates with "make update-copyright" 2020-01-08 18:39:17 -05:00
transport_config.h It's 2020. Update the copyright dates with "make update-copyright" 2020-01-08 18:39:17 -05:00