summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-12-08 08:45:09 -0500
committerNick Mathewson <nickm@torproject.org>2015-12-08 08:45:09 -0500
commit1321608786c452ab9f0bf19f37509938f7755117 (patch)
tree9a858f435085a8663c5813b6b846f6661a706ccd /src/or
parentd6adb26a49c516475ca5ef0f32a1c255cc131fe8 (diff)
parente9bf584694a592852293b945575d17ea4c3b742b (diff)
downloadtor-1321608786c452ab9f0bf19f37509938f7755117.tar.gz
tor-1321608786c452ab9f0bf19f37509938f7755117.zip
Merge branch 'maint-0.2.7'
Diffstat (limited to 'src/or')
-rw-r--r--src/or/policies.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/policies.c b/src/or/policies.c
index 943b0c4492..0d8819e2e8 100644
--- a/src/or/policies.c
+++ b/src/or/policies.c
@@ -1530,9 +1530,9 @@ policy_write_item(char *buf, size_t buflen, addr_policy_t *policy,
if (result < 0)
return -1;
written += strlen(buf);
- /* If the maskbits is 32 we don't need to give it. If the mask is 0,
- * we already wrote "*". */
- if (policy->maskbits < 32 && policy->maskbits > 0) {
+ /* If the maskbits is 32 (IPv4) or 128 (IPv6) we don't need to give it. If
+ the mask is 0, we already wrote "*". */
+ if (policy->maskbits < (is_ip6?128:32) && policy->maskbits > 0) {
if (tor_snprintf(buf+written, buflen-written, "/%d", policy->maskbits)<0)
return -1;
written += strlen(buf+written);