Commit Graph

11593 Commits

Author SHA1 Message Date
Nick Mathewson
8eb422e7bd Don't use the cache when changing an IP address because of an exit policy 2012-12-17 14:50:05 -05:00
Nick Mathewson
ac990aa44a Turn off by-default use of client-side DNS cacheing. 2012-12-17 14:50:04 -05:00
Nick Mathewson
7315a67646 Refactor port_cfg_t creation into a port_cfg_new() function
This function gives us a single place to set reasonable default flags
for port_cfg_t entries, to avoid bugs like the one where we weren't
setting ipv4_traffic_ok to 1 on SocksPorts initialized in an older
way.
2012-12-17 14:50:03 -05:00
Nick Mathewson
7536c40e96 Implement option to turn off DNS cache modification by a client port
(This is part 3 of making DNS cache use enabled/disabled on a
per-client port basis.  This implements the UseCacheIPv[46]DNS options)
2012-12-17 14:48:09 -05:00
Nick Mathewson
f33487668f Implement option to turn off DNS cache use on a client port
(This is part 2 of making DNS cache use enabled/disabled on a
per-client port basis.  This implements the CacheIPv[46]DNS options,
but not the UseCachedIPv[46] ones.)
2012-12-17 14:48:09 -05:00
Nick Mathewson
32219d8313 Oops: make the check for not adding ip->ip DNS maps correct 2012-12-17 14:48:09 -05:00
Nick Mathewson
d3e9e03cac Add options to turn DNS cache use on or off per client port.
(This is part 1 of making DNS cache use enabled/disabled on a
per-client port basis.  These options are shuffled around correctly,
but don't do anything yet.)
2012-12-17 14:48:08 -05:00
Nick Mathewson
44a9a47706 Oops; make DNSPort configuration take address family options 2012-12-17 14:48:08 -05:00
Nick Mathewson
3874e74b49 Avoid a 'may be used uninitialized' warning
Fixes bug 7746; bug not in any released version of Tor.
2012-12-17 11:14:12 -05:00
Nick Mathewson
b1ff8daeb5 Nuke uses of memcmp outside of unit tests
We want to be saying fast_mem{cmp,eq,neq} when we're doing a
comparison that's allowed to exit early, or tor_mem{cmp,eq,neq} when
we need a data-invariant timing.  Direct use of memcmp tends to imply
that we haven't thought about the issue.
2012-12-13 17:34:05 -05:00
Nick Mathewson
579808d4cd Merge remote-tracking branch 'origin/maint-0.2.3'
Conflicts:
	src/config/geoip
2012-12-13 12:52:44 -05:00
Nick Mathewson
52bf1556b1 Merge remote-tracking branch 'origin/maint-0.2.2' into maint-0.2.3 2012-12-13 12:51:28 -05:00
Nick Mathewson
6a468a1722 Fix two wide lines in config.c 2012-12-13 12:44:17 -05:00
Nick Mathewson
01ac961ca1 Merge branch 'fallback_dirsource_v3' 2012-12-13 12:42:29 -05:00
Karsten Loesing
6bdfa295b5 Add link explaining how the geoip file was created. 2012-12-13 08:45:25 +01:00
Karsten Loesing
c9a5d613a6 Update to the December 2012 GeoIP database. 2012-12-13 08:44:30 +01:00
Karsten Loesing
d2cfd52d2c Update to the November 2012 GeoIP database. 2012-12-13 08:44:20 +01:00
Mike Perry
ccaeef22e1 Tags on relay cells can result in certain reason codes.
Close the circuit (it's probably junk anyways), and make sure we don't probe
it/count it as a success.
2012-12-11 17:49:12 -08:00
Mike Perry
af9011f824 Woops, this log message triggers with the 2-hop bias commit. 2012-12-11 17:19:39 -08:00
Mike Perry
c1bc6a1124 Add a missing comment. 2012-12-10 00:36:10 -08:00
Mike Perry
d409c8a90d More log message and space fixups. 2012-12-10 00:28:07 -08:00
Mike Perry
aa16d59ee7 Clean up some XXX comments. 2012-12-09 23:50:05 -08:00
Mike Perry
4590993ff3 Space fixes. 2012-12-09 23:47:04 -08:00
Mike Perry
b75880d7b3 Fix a rather serious use-count state bug.
We need to use the success count or the use count depending on the consensus
parameter.
2012-12-09 20:56:48 -08:00
Mike Perry
2dbb62f1b5 Convert to doubles for all pathbias state.
Let's hope this solves the rounding error issue..
2012-12-09 20:53:22 -08:00
Mike Perry
ab1fce5c19 Also shorten circuit_successes to circ_successes.
For consistency and great justice.

Ok, mostly consistency.
2012-12-09 20:24:50 -08:00
Mike Perry
a90f165b83 Rename first_hop to circ_attempt.
Since we've generalized what we can count from (first or second hop), we
should generalize the variable and constant naming too.
2012-12-09 20:24:22 -08:00
Mike Perry
04866055e8 Change from first hop accounting to 2nd hop accounting
This has several advantages, including more resilience to ambient failure.

I still need to rename all the first_hop vars tho.. Saving that for a separate
commit.
2012-12-09 20:02:41 -08:00
Mike Perry
fbbf894d4d Add intro+rend cannibalize param.. 2012-12-09 20:02:08 -08:00
Mike Perry
930fbb2fec Flag cannibalized circs as used (non-ideal).
Also add some comments.
2012-12-09 19:18:04 -08:00
Mike Perry
686fc22259 Allow any valid 'end' cell to mean a circuit was used successfully.
Also improve some log messages.
2012-12-08 16:37:22 -08:00
Mike Perry
b599a6ed07 Sadly, we can't safely count client intro circ success 2012-12-08 14:16:29 -08:00
Mike Perry
5f733ccd73 Fix some hidden service edge cases. 2012-12-08 12:07:58 -08:00
Mike Perry
26fa47226c Refactor path use bias code into own function.
Also, improve and log some failure cases.
2012-12-07 17:47:23 -08:00
Mike Perry
c3b71a3fc9 Actually, both nacks and acks indicate a valid path 2012-12-07 15:50:31 -08:00
Mike Perry
dc86d7c35b Note more potential issues. 2012-12-07 15:28:38 -08:00
Mike Perry
ecaeb505fa Note a strange case for SOCKS streams. 2012-12-07 15:28:38 -08:00
Mike Perry
7a28862d56 Fix another crash bug. 2012-12-07 15:28:38 -08:00
Mike Perry
721f7e3751 Fix a crash bug and pass down a remote reason code.
Unexpected channel closures count as remote circ failures.
2012-12-07 15:28:38 -08:00
Mike Perry
9b40466072 Document that care needs to be taken with any_streams_attached. 2012-12-07 15:28:38 -08:00
Mike Perry
c3028edba6 Remove n_chan codepaths for determinining guard.
Cpath is apparently good enough.
2012-12-07 15:28:38 -08:00
Mike Perry
a630726884 Move a pathbias function that depends on entryguard_t. 2012-12-07 15:28:38 -08:00
Mike Perry
7f8cbe389d Fix a crash due to NULL circ->n_chan.
Is this redundant? Can we always rely on circ->cpath->extend_info
being present for origin circuits?
2012-12-07 15:28:38 -08:00
Mike Perry
428fbfc1d5 Prop209: Rend circuits weren't ever marked dirty. 2012-12-07 15:28:38 -08:00
Mike Perry
aa0e6e2c03 Prop 209: Add in hidserv path bias counts for usage. 2012-12-07 15:28:38 -08:00
Mike Perry
412ae099cb Prop 209: Add path bias counts for timeouts and other mechanisms.
Turns out there's more than one way to block a tagged circuit.

This seems to successfully handle all of the normal exit circuits. Hidden
services need additional tweaks, still.
2012-12-07 15:28:38 -08:00
Mike Perry
da5c398d79 Be explicit about units for timeout. 2012-12-07 15:28:37 -08:00
Mike Perry
ef1b830ef8 Fix an assert crash and an incorrectly placed return. 2012-12-07 15:28:37 -08:00
Mike Perry
bb548134cd Update with code review changes from Nick. 2012-12-07 15:28:37 -08:00
Mike Perry
192996690c Fix spaces. 2012-12-07 15:28:37 -08:00
Mike Perry
a54873648f Refactor pathbias functions to use pathbias_should_count. 2012-12-07 15:28:37 -08:00
Mike Perry
ab9c83c949 Update Path Bias log messages to match Proposal 209. 2012-12-07 15:28:37 -08:00
Mike Perry
9bf5582e73 Add log message checks for different rates.
May want to squash this forward or back..
2012-12-07 15:28:37 -08:00
Mike Perry
248fbc3619 Update pathbias parameters to match Proposal 209.
Needs manpage update and testing still..
2012-12-07 15:28:37 -08:00
Mike Perry
954f263ed5 Add the ability to count circuit timeouts for guards.
This is purely for informational reasons for debugging.
2012-12-07 15:28:36 -08:00
Nick Mathewson
c8056dcbbb Fix some wide lines 2012-12-07 14:14:20 -05:00
Nick Mathewson
3fa9151f26 Merge branch 'win64-7260'
Conflicts:
	src/or/dns.c
2012-12-07 14:12:17 -05:00
Nick Mathewson
cd4f56a37c Fix infinite loop in circuit_expire_bulding
Fixes bug 7663; bug introduced in 42e3c04a7a.  Not in any
released version of Tor.
2012-12-07 14:08:07 -05:00
Nick Mathewson
f366b0112e Merge remote-tracking branch 'karsten/task-6266' 2012-12-07 11:39:56 -05:00
Nick Mathewson
81fcebcd05 Merge branch 'bug7306' 2012-12-07 11:11:26 -05:00
Nick Mathewson
025dc19b63 Merge remote-tracking branch 'public/bug6887' 2012-12-07 11:02:27 -05:00
Mike Perry
42e3c04a7a Bug 3443: Don't count ORconn setup in circuit build time.
Also, add a hack Roger suggested where we're more patient if no circuits are
opened yet.
2012-12-07 10:34:09 -05:00
Nick Mathewson
f742b33d85 Drop FallbackNetworkstatusFile; it never worked. 2012-12-06 11:28:49 -05:00
Nick Mathewson
a8d491a8fd Add an option to weight down authorities when choosing a fallback 2012-12-06 11:28:49 -05:00
Nick Mathewson
06cd62266f Add a way to configure selection weights for dir_server_t 2012-12-06 11:28:49 -05:00
Nick Mathewson
4e3d07a68a When choosing among dirserver_ts, consider their weights 2012-12-06 11:28:49 -05:00
Nick Mathewson
90f6071d8d New FallbackDir option to add extra directories for bootstraping
This replaces the old FallbackConsensus notion, and should provide a
way -- assuming we pick reasonable nodes! -- to give clients
suggestions of placs to go to get their first consensus.
2012-12-06 11:28:49 -05:00
Nick Mathewson
46a62e3256 Refactor add_trusted_dir_server
Now creating a dir_server_t and adding it are separate functions, and
there are frontend functions for adding a trusted dirserver and a
fallback dirserver.
2012-12-06 11:28:48 -05:00
Nick Mathewson
705ee3b5d4 Rename trusted_dir_server_t to dir_server_t. Automatic renaming. 2012-12-06 11:27:20 -05:00
Nick Mathewson
ded70363a7 Rename DirServer to DirAuthority 2012-12-06 11:23:43 -05:00
Nick Mathewson
5c51b3f1f0 Start refactoring trusted_dir_servers into trusted and fallback lists
We use trusted_dir_server_t for two pieces of functionality: a list of
all directory authorities, and a list of initial places to look for
a directory.  With this patch we start to separate those two roles.

There is as of now no actual way to be a fallback directory without being
an authority.
2012-12-06 11:23:43 -05:00
Nick Mathewson
404e3dd481 Correct moribund logic about caching v2 networkstatuses 2012-12-06 11:15:01 -05:00
Nick Mathewson
194cc24792 Make output of router_get_trusted_dir_servers const 2012-12-06 11:15:01 -05:00
Nick Mathewson
b326e76144 Use FreeLibrary, not CloseHandle, for library in test_util.c
Fix for bug 7306. Bugfix on 0.2.2.17-alpha.
2012-12-06 10:59:02 -05:00
Karsten Loesing
c718921d34 Update to the December 2012 GeoIP database. 2012-12-06 11:29:47 +01:00
Nick Mathewson
014e69054d Add a unit test for the old KDF while we're at it 2012-12-06 01:54:09 -05:00
Nick Mathewson
6921d1fd25 Implement HKDF from RFC5869
This is a customizable extract-and-expand HMAC-KDF for deriving keys.
It derives from RFC5869, which derives its rationale from Krawczyk,
H., "Cryptographic Extraction and Key Derivation: The HKDF Scheme",
Proceedings of CRYPTO 2010, 2010, <http://eprint.iacr.org/2010/264>.

I'm also renaming the existing KDF, now that Tor has two of them.

This is the key derivation scheme specified in ntor.

There are also unit tests.
2012-12-06 01:54:09 -05:00
Nick Mathewson
4f60bca1c1 Add benchmark to test onionskin performance. 2012-12-06 01:54:09 -05:00
Nick Mathewson
3c3084e165 Add a crypto_dh_dup, for benchmark support 2012-12-06 01:54:09 -05:00
Nick Mathewson
bd93ff8dd7 Merge remote-tracking branch 'asn/bug7592_take2' 2012-12-04 21:47:45 -05:00
George Kadianakis
c01dfd5d7b Return connection_exit_connect() if payload creation failed.
Fixes bug #7592; bugfix on 882b389668.

The bug is not present in any released versions of Tor.
2012-12-05 04:32:11 +02:00
Roger Dingledine
e899d49e2f fix some typos 2012-12-03 13:33:43 -05:00
Nick Mathewson
190c1d4981 Merge branch 'bug7013_take2_squashed' 2012-11-27 22:18:16 -05:00
George Kadianakis
6f21d2e496 Introduce tor_addr_port_parse() and use it to parse ServerTransportListenAddr. 2012-11-27 22:18:08 -05:00
George Kadianakis
f88c303869 Add a torrc option to specify the bind address of managed proxies. 2012-11-27 22:18:08 -05:00
Karsten Loesing
35d09dd6ac Update to the November 2012 GeoIP database. 2012-11-27 21:26:52 -05:00
Karsten Loesing
2bf195d0ce Add script to fix "A1" entries in geoip file.
Fixes #6266.
2012-11-27 21:24:07 -05:00
Nick Mathewson
267c0e5aa1 Make sure that the error in ADDRMAP events is well-formed
"error=Unable to launch resolve request" is not a nice thing to tell
the controller.  Bugfix on 0.2.0.19-alpha (c11c48fc).
2012-11-23 11:36:44 -05:00
Nick Mathewson
06703f84df Minor documentation fix 2012-11-23 10:51:11 -05:00
Nick Mathewson
99669c69b3 Note limitation of parse_rfc_1123_time
RFC1123 suggests that we should handle two-year times, and a full
range of time zones, and other stuff too.  We don't.
2012-11-23 10:06:16 -05:00
Nick Mathewson
864e15cd1c In comments and logs, say "UTC" not "GMT"
Fix for #6113.

Note that the RFC1123 times we generate still all say 'GMT'.  I'm
going to suggest this is not worth changing.
2012-11-23 10:05:16 -05:00
Nick Mathewson
e6828ea634 Refer to RFC 4648 instead of the obsolete RFC 3548
Affects comments only. For ticket 6849.
2012-11-23 09:51:35 -05:00
Nick Mathewson
ea893a3c30 Merge branch 'bug7493_redux' 2012-11-18 18:46:57 -05:00
Nick Mathewson
bfe8d829c2 Initialize ipv{4,6}_traffic_ok in entry_connection_new
This one is necessary for sending BEGIN cells with sane flags when
self-testing a directory port.  All real entry connections were
getting their ipv{4,6}_traffic_ok flags set from their listeners, and
for begindir entry connections we didn't care, but for directory
self-testing, we had a problem.

Fixes at least one more case of 7493; if there are more lingering
cases of 7493, this might fix them too.

Bug not in any released version of Tor.
2012-11-18 17:15:41 -05:00
Roger Dingledine
06d367ea36 when counting available descs, say whether we're counting exits 2012-11-16 11:38:56 -05:00
Nick Mathewson
ecb619d96b Give useful warning when both IPv4 and IPv6 are disabled on a socksport 2012-11-15 22:58:54 -05:00
Nick Mathewson
28cbe90839 Allow IPv4 traffic on default and old-style-config SocksPorts.
Looks like when i was writing the code to set the ipv4_traffic flag on
port_cfg_t, I missed some cases, such as the one where the port was
set from its default value.

Fix for 7493. Bug not in any released Tor.
2012-11-15 22:49:43 -05:00
Nick Mathewson
1e46952f36 Set IPv4/IPv6 flags correctly when being a SOCKS client 2012-11-15 13:00:19 -05:00
Nick Mathewson
a4fce0fee8 Remove some XXXX commens in dns.c
Previously, I was freaking out about passing an unspec address to
dns_found_answer() on an error, since I was using the address type to
determine whether the error was an error on an ipv4 address lookup or
on an ipv6 address lookup.  But now dns_found_answer() has a separate
orig_query_type argument to tell what kind of query it is, so there's
no need to freak out.
2012-11-15 12:17:36 -05:00
Nick Mathewson
12f997528d Fix up some comments in connection_edge.c 2012-11-15 12:17:30 -05:00
Nick Mathewson
e3ceac38d9 Add another missing function doc 2012-11-14 23:16:58 -05:00
Nick Mathewson
d643487cc2 Initial support for AAAA requests on DNSPort.
This is imperfect, since it sends back whatever we would send to
a socks RESOLVE request, when in reality we should send back whatever
was asked for.
2012-11-14 23:16:58 -05:00
Nick Mathewson
053f2cb7c8 Let tor-resolve generate PTR requests for IPv6 addresses 2012-11-14 23:16:57 -05:00
Nick Mathewson
50af1087c4 Accept reverse resolve requests for IPv6 addresses 2012-11-14 23:16:57 -05:00
Nick Mathewson
4db49f2b27 Add IPv6 support to tor-resolve so it can hear about IPv6 answers 2012-11-14 23:16:57 -05:00
Nick Mathewson
0f899518cf Make DNS resolve requests work for IPv6
* If there's an IPv4 and an IPv6 address, return both in the resolved
  cell.
* Treat all resolve requests as permitting IPv6, since by the spec they're
  allowed to, and by the code that won't break anything.
2012-11-14 23:16:57 -05:00
Nick Mathewson
bb2145b45b Fix a bug in policy_is_reject_star() that was making IPv4 exits break
IPv4-only exits have an implicit "reject [::]/0", which was making
policy_is_reject_star() return 1 for them, making us refuse to do
hostname lookups.

This fix chanes policy_is_reject_star() to ask about which family we meant.
2012-11-14 23:16:57 -05:00
Nick Mathewson
85e8d35fca Add some missing doxygen for ipv6 exit code 2012-11-14 23:16:57 -05:00
Nick Mathewson
882b389668 Actually send back correctly-formed IPv6 CONNECTED cells
We had some old code to send back connected cells for IPv6 addresses,
but it was wrong.  Fortunately, it was also unreachable.
2012-11-14 23:16:41 -05:00
Nick Mathewson
6b36142bcc Remove some unused defines in dns.c 2012-11-14 23:16:40 -05:00
Nick Mathewson
7197c9f14a Repair DNS NEXIST hijacking workaround
The code previously detected wildcarding and replaced wildcarded
answers with DNS_STATUS_FAILED_PERMANENT.  But that status variable
was no longer used!  Remove the status variable, and instead change
the value of 'result' in evdns_callback.

Thank goodness for compiler warnings. In this case,
unused-but-set-variable.

Thanks to Linus for finding this one.
2012-11-14 23:16:40 -05:00
Nick Mathewson
363cf02455 Implement a PreferIPv6 flag for SocksPorts 2012-11-14 23:16:40 -05:00
Nick Mathewson
c4830bfbe2 Define a wrapper for evdns_base_resolve_ipv6 for systems w/o libevent 2 2012-11-14 23:16:40 -05:00
Nick Mathewson
35ce42118f Make address_is_invalid_destination recognize ipv6 addrs as valid. 2012-11-14 23:16:40 -05:00
Nick Mathewson
1cc7736575 Actually generate microdescriptors with p6 lines. 2012-11-14 23:16:40 -05:00
Nick Mathewson
54ee7ff148 Remove a since-fixed XXX; improve a doxygen comment 2012-11-14 23:16:40 -05:00
Nick Mathewson
004f3f4e53 Actually advertise IPv6 exit policies.
I have a theory that my tests will work better if the code I'm testing
isn't disabled.
2012-11-14 23:16:40 -05:00
Nick Mathewson
2889bd2642 Revise the DNS subsystem to handle IPv6 exits.
Now, every cached_resolve_t can remember an IPv4 result *and* an IPv6
result.  As a light protection against timing-based distinguishers for
IPv6 users (and against complexity!), every forward request generates
an IPv4 *and* an IPv6 request, assuming that we're an IPv6 exit.  Once
we have answers or errors for both, we act accordingly.

This patch additionally makes some useful refactorings in the dns.c
code, though there is quite a bit more of useful refactoring that could
be done.

Additionally, have a new interface for the argument passed to the
evdns_callback function.  Previously, it was just the original address
we were resolving.  But it turns out that, on error, evdns doesn't
tell you the type of the query, so on a failure we didn't know whether
IPv4 or IPv6 queries were failing.

The new convention is to have the first byte of that argument include
the query type.  I've refactored the code a bit to make that simpler.
2012-11-14 23:16:25 -05:00
Nick Mathewson
a58e17bcc3 Change signature of router_compare_to_my_exit_policy so dns can use it
Also, fix the function so it actually looks at our ipv6 exit policy.
2012-11-14 23:16:25 -05:00
Nick Mathewson
25cf286fb1 Whitespace cleanup 2012-11-14 23:16:24 -05:00
Nick Mathewson
0487c0d579 Reindent a block in dns.c 2012-11-14 23:16:24 -05:00
Nick Mathewson
807b781a3d Actually send BEGIN cell flags
This uses advertised IPv6 ports as an implicit version check.
2012-11-14 23:16:24 -05:00
Nick Mathewson
93591383a9 When asking for a specific address type, others aren't acceptable 2012-11-14 23:16:24 -05:00
Nick Mathewson
d276894772 I think it is correct to decorate these addresses. 2012-11-14 23:16:24 -05:00
Nick Mathewson
6e27282dab Better checking of exit policies for connections by hostname 2012-11-14 23:16:24 -05:00
Nick Mathewson
5ee1de65b0 Only send begin cell flags when we have some to send 2012-11-14 23:16:24 -05:00
Nick Mathewson
a62c03fe2c Never support IPv6 traffic on a SOCKS4 connection. 2012-11-14 23:16:24 -05:00
Nick Mathewson
898f9c8bcc Add a function to set a tor_addr_t to a null address 2012-11-14 23:16:23 -05:00
Nick Mathewson
cac5335195 Get the client side of receiving an IPv6 address to work
This makes it so we can handle getting an IPv6 in the 3 different
formats we specified it for in RESOLVED cells,
END_STREAM_REASON_EXITPOLICY cells, and CONNECTED cells.

We don't cache IPv6 addresses yet, since proposal 205 isn't
implemented.

There's a refactored function for parsing connected cells; it has unit
tests.
2012-11-14 23:16:23 -05:00
Nick Mathewson
93dc7dcf41 Reject IPv4 or IPv6 addresses from the user depending on SOCKS settings 2012-11-14 23:16:23 -05:00
Nick Mathewson
111321ed16 Rename ipv{4,6}_only to bind_ipv{4,6}_only
This is to avoid confusion with the ipv{4,6}_traffic flags.
2012-11-14 23:16:23 -05:00
Nick Mathewson
4bec25c3cd Add {No,}IPv{4,6}Traffic options to SOCKSPort
These options are for telling the SOCKSPort that it should allow or
not allow connections to IPv4/IPv6 addresses.

These aren't implemented yet; this is just the code to read the
options and get them into the entrey_connection_t.
2012-11-14 23:16:23 -05:00
Nick Mathewson
b7843ca554 Make DNS callback pass IPv6 answers to dns_answer_found
Also, count ipv6 timeouts vs others.  If we have too many ipv6
requests time out, then we could be degrading performance because of a
broken DNS server that ignores AAAA requests.  Other cases in which
we never learn an AAAA address aren't so bad, since they don't slow
A (ipv4) answers down very much.
2012-11-14 23:16:23 -05:00
Nick Mathewson
00633b9446 Make dns wildcarding checks work for ipv6 2012-11-14 23:16:22 -05:00
Nick Mathewson
9016d9e829 Add an IPv6Exit configuration option
Don't advertise an IPv6 exit policy, or accept IPv6 exit requests,
if IPv6Exit is not true.
2012-11-14 23:16:22 -05:00
Nick Mathewson
c3faa0ebd5 Simplest version of server-side IPv6 support (no dns)
This is a relatively simple set of changes: we mostly need to
remove a few "but not for IPv6" changes.  We also needed to tweak
the handling of DNS code to generate RESOLVED cells that could get
an IPv6 answer in return.
2012-11-14 23:16:22 -05:00
Nick Mathewson
c64ee7099f Record, send, and receive flags in BEGIN cells 2012-11-14 23:16:22 -05:00
Nick Mathewson
b35a0d1132 Add IPv6 support to compare_to_addr_to_node_policy 2012-11-14 23:16:22 -05:00
Nick Mathewson
04ea550141 Authorities put p6 lines into microdescriptors. 2012-11-14 23:16:22 -05:00
Nick Mathewson
c53adac122 Parse IPv6 policy summaries from router descriptors and microdescs 2012-11-14 23:16:22 -05:00
Nick Mathewson
a96c0affcb 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:*"
2012-11-14 23:16:21 -05:00
Nick Mathewson
2eb7eafc9d Add a new family-specific syntax for tor_addr_parse_mask_ports
By default, "*" means "All IPv4 addresses" with
tor_addr_parse_mask_ports, so I won't break anything.  But if the new
EXTENDED_STAR flag is provided, then * means "any address", *4 means
"any IPv4 address" (that is, 0.0.0.0/0), and "*6" means "any IPv6
address" (that is, [::]/0).

This is going to let us have a syntax for specifying exit policies in
torrc that won't drive people mad.

Also, add a bunch of unit tests for tor_addr_parse_mask_ports to test
these new features, and to increase coverage.
2012-11-14 23:16:21 -05:00
Nick Mathewson
462ebb270a Refactor begin cell parsing into its own function, with tests.
Add 'flags' argument to begin cells, per proposal 208.
2012-11-14 23:16:21 -05:00
Nick Mathewson
ca8843df0a Refactor client_dns_set_{reverse_,}addressmap() to take a circ
We'd like these functions to be circuit-relative so that we can
implement a per-circuit DNS cache and per-circuit DNS cache rules for
proposal 205 or its successors.  I'm doing this now, as a part of the
IPv6 exits code, since there are about to be a few more instances
of code using this.
2012-11-14 23:16:21 -05:00
Nick Mathewson
7908ab2093 Move address map into its own file. 2012-11-14 23:16:20 -05:00
Andrea Shepard
2cb82c33bc Merge branch 'bug7267' of ssh://git-rw.torproject.org/user/andrea/tor 2012-11-13 18:54:24 -08:00
Andrea Shepard
3db3daa663 Add comment explaining different channel close functions 2012-11-13 18:50:37 -08:00
Nick Mathewson
02a43e5eb6 Merge remote-tracking branch 'public/bug7059' 2012-11-13 21:50:07 -05:00
Nick Mathewson
b17aa28e46 Actually distribute the geoip6 file.
Fixes a bug (with no ticket) on 0.2.4.6-alpha.
2012-11-13 21:24:28 -05:00
Andrea Shepard
7ab3004223 Call channel_mark_for_close() properly in hibernate_go_dormant() 2012-11-13 13:45:00 -08:00