summaryrefslogtreecommitdiff
path: root/src/test/test.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-10-24 15:03:29 -0400
committerNick Mathewson <nickm@torproject.org>2012-11-14 23:16:21 -0500
commita96c0affcb4cda1a2e0d83d123993d10efc6e396 (patch)
tree179be96049286cae1b9b1aa4b633f60da2c29023 /src/test/test.c
parent2eb7eafc9d789cb5063dd36021412434b656bf75 (diff)
downloadtor-a96c0affcb4cda1a2e0d83d123993d10efc6e396.tar.gz
tor-a96c0affcb4cda1a2e0d83d123993d10efc6e396.zip
Better policy support for IPv6
Now, "accept *:80" means "accept all addresses on port 80", and not just IPv4. For just v4, say "accept *4:80"; for just v6 say "accept *6:80". We can parse these policies from torrc just fine, and we should be successfully keeping them out of descriptors for now. We also now include appropriate IPv6 addresses in "reject private:*"
Diffstat (limited to 'src/test/test.c')
-rw-r--r--src/test/test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test.c b/src/test/test.c
index fc3c36e300..6652e77098 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -1046,7 +1046,7 @@ test_policy_summary_helper(const char *policy_str,
r = policies_parse_exit_policy(&line, &policy, 0, NULL, 1);
test_eq(r, 0);
- summary = policy_summarize(policy);
+ summary = policy_summarize(policy, AF_INET);
test_assert(summary != NULL);
test_streq(summary, expected_summary);
@@ -1192,7 +1192,7 @@ test_policies(void)
test_assert(policy);
//test_streq(policy->string, "accept *:80");
//test_streq(policy->next->string, "reject *:*");
- test_eq(smartlist_len(policy), 2);
+ test_eq(smartlist_len(policy), 4);
/* test policy summaries */
/* check if we properly ignore private IP addresses */