summaryrefslogtreecommitdiff
path: root/src/common/address.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-10-11 11:08:20 -0400
committerNick Mathewson <nickm@torproject.org>2016-10-11 11:08:20 -0400
commitd25fed51746e848fc04cabefe58133e3957209de (patch)
tree87d7b520a09624945f791084f04bc6e8423412e5 /src/common/address.c
parent5a9696fad864406d7d65cc25e356c543957e596f (diff)
parent7b2c856785b226ee20867450daa8436c3020e950 (diff)
downloadtor-d25fed51746e848fc04cabefe58133e3957209de.tar.gz
tor-d25fed51746e848fc04cabefe58133e3957209de.zip
Merge remote-tracking branch 'yawning-schwanenlied/bug20261'
Diffstat (limited to 'src/common/address.c')
-rw-r--r--src/common/address.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/common/address.c b/src/common/address.c
index 15ee3dbd17..dae1800919 100644
--- a/src/common/address.c
+++ b/src/common/address.c
@@ -1041,6 +1041,10 @@ tor_addr_copy_tight(tor_addr_t *dest, const tor_addr_t *src)
* Different address families (IPv4 vs IPv6) are always considered unequal if
* <b>how</b> is CMP_EXACT; otherwise, IPv6-mapped IPv4 addresses are
* considered equivalent to their IPv4 equivalents.
+ *
+ * As a special case, all AF_UNIX addresses are always considered equal
+ * since tor_addr_t currently does not contain the information required to
+ * make the comparison.
*/
int
tor_addr_compare(const tor_addr_t *addr1, const tor_addr_t *addr2,
@@ -1114,6 +1118,18 @@ tor_addr_compare_masked(const tor_addr_t *addr1, const tor_addr_t *addr2,
return 0;
}
}
+ case AF_UNIX:
+ /* HACKHACKHACKHACKHACK:
+ * tor_addr_t doesn't contain a copy of sun_path, so it's not
+ * possible to comapre this at all.
+ *
+ * Since the only time we currently actually should be comparing
+ * 2 AF_UNIX addresses is when dealing with ISO_CLIENTADDR (which
+ * is diesabled for AF_UNIX SocksPorts anyway), this just returns 0.
+ *
+ * See: #20261.
+ */
+ return 0;
default:
/* LCOV_EXCL_START */
tor_fragile_assert();