summaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-10-13 09:17:41 -0400
committerNick Mathewson <nickm@torproject.org>2016-10-13 09:19:51 -0400
commit49d7feb8a0ecf7e3bc54c5cd7e0d2a96decdf08e (patch)
tree6d0cd2b85e0bfae82a1a8d7b3d8f90326bcd363f /src/or/config.c
parent1fc3e291083493bd7517901f467a7341d5c6f650 (diff)
downloadtor-49d7feb8a0ecf7e3bc54c5cd7e0d2a96decdf08e.tar.gz
tor-49d7feb8a0ecf7e3bc54c5cd7e0d2a96decdf08e.zip
Tweak patch for 18529.
- function doesn't need to be inline. - rename function - Make documentation more pedantically correct - Remove needless "? 1 : 0."
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c
index bef81ab812..166f232f46 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -2312,6 +2312,14 @@ reset_last_resolved_addr(void)
last_resolved_addr = 0;
}
+/* Return true if <b>options</b> is using the default authorities, and false
+ * if any authority-related option has been overridden. */
+int
+using_default_dir_authorities(const or_options_t *options)
+{
+ return (!options->DirAuthorities && !options->AlternateDirAuthority);
+}
+
/**
* Attempt getting our non-local (as judged by tor_addr_is_internal()
* function) IP address using following techniques, listed in
@@ -2471,7 +2479,7 @@ resolve_my_address(int warn_severity, const or_options_t *options,
addr_string = tor_dup_ip(addr);
if (tor_addr_is_internal(&myaddr, 0)) {
/* make sure we're ok with publishing an internal IP */
- if (is_default_dir_authorities(options)) {
+ if (using_default_dir_authorities(options)) {
/* if they are using the default authorities, disallow internal IPs
* always. */
log_fn(warn_severity, LD_CONFIG,