aboutsummaryrefslogtreecommitdiff
path: root/src/or/dns.c
AgeCommit message (Collapse)Author
2017-11-30Merge branch 'maint-0.3.0' into maint-0.3.1Nick Mathewson
2017-11-30Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-11-05Fix DNS resolution on busy exit relaysSebastian Hahn
Thanks to Dhalgren who analyzed this issue two years ago and found a solution!
2017-09-11Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-09-11Fix GCC 7 -Wimplicit-fallthrough warningsAndreas Stieger
Add magic comments recognized by default -Wimplicit-fallthrough=3 or break, as required.
2017-05-30Fix GCC 7 -Wimplicit-fallthrough warningsAndreas Stieger
Add magic comments recognized by default -Wimplicit-fallthrough=3 or break, as required.
2017-05-26Cleanup MOCK_IMPL (etc) to be findable with etagsNick Mathewson
A fair number of our mock_impl declarations were messed up so that even our special AM_ETAGSFLAGS couldn't find them. This should be a whitespace-only patch.
2017-05-15Fix assertion to actually have a chance of failingNick Mathewson
This assertion can only fail if we mess up some of our other code, but let's try to get it right. Closes 22244.
2017-03-15Run the copyright update script.Nick Mathewson
2017-01-18Merge branch 'bug19769_19025_029'Nick Mathewson
2017-01-18Initialise DNS TTL for A and AAAA records.Philipp Winter
So far, the TTLs for both A and AAAA records were not initialised, resulting in exit relays sending back the value 60 to Tor clients. This also impacts exit relays' DNS cache -- the expiry time for all domains is set to 60. This fixes <https://bugs.torproject.org/19025>.
2017-01-18DefecTor countermeasure: change server- and client-side DNS TTL clippingNick Mathewson
The server-side clipping now clamps to one of two values, both for what to report, and how long to cache. Additionally, we move some defines to dns.h, and give them better names.
2016-10-27Automated change to use smartlist_add_strdupovercaffeinated
Use the following coccinelle script to change uses of smartlist_add(sl, tor_strdup(str)) to smartlist_add_strdup(sl, string) (coccinelle script from nickm via bug 20048): @@ expression a; expression b; @@ - smartlist_add + smartlist_add_strdup (a, - tor_strdup( b - ) )
2016-10-17Write a bunch of module documentation.Nick Mathewson
This commit adds or improves the module-level documenation for: buffers.c circuitstats.c command.c connection_edge.c control.c cpuworker.c crypto_curve25519.c crypto_curve25519.h crypto_ed25519.c crypto_format.c dircollate.c dirserv.c dns.c dns_structs.h fp_pair.c geoip.c hibernate.c keypin.c ntmain.c onion.c onion_fast.c onion_ntor.c onion_tap.c periodic.c protover.c protover.h reasons.c rephist.c replaycache.c routerlist.c routerparse.c routerset.c statefile.c status.c tor_main.c workqueue.c In particular, I've tried to explain (for each documented module) what each module does, what's in it, what the big idea is, why it belongs in Tor, and who calls it. In a few cases, I've added TODO notes about refactoring opportunities. I've also renamed an argument, and fixed a few DOCDOC comments.
2016-07-04Raise libevent dependency to 2.0.10-stable or newerSebastian Hahn
Only some very ancient distributions don't ship with Libevent 2 anymore, even the oldest supported Ubuntu LTS version has it. This allows us to get rid of a lot of compat code.
2016-02-27Update the copyright year.Nick Mathewson
2015-12-15Replace usage of INLINE with inlinecypherpunks
This patch was generated using; sed -i -e "s/\bINLINE\b/inline/" src/*/*.[ch] src/*/*/*.[ch]
2015-10-24Seventh test case for dns_resolve_impl().rl1987
2015-10-24Sixth test case for dns_resolve_impl.rl1987
2015-10-24Add a fifth unit test.rl1987
2015-08-23Unit test dns_resolve(), dns_clip_ttl(), dns_get_expiry_ttl().rl1987
2015-03-14Remove relative paths to header files.cypherpunks
The paths are already in the directory search path of the compiler therefore no need to include them in the source code.
2015-01-12Merge remote-tracking branch 'origin/maint-0.2.5'Nick Mathewson
2015-01-12Merge remote-tracking branch 'public/bug14129_024' into maint-0.2.5Nick Mathewson
2015-01-08Avoid attempts to double-remove edge connections from the DNS resolver.Nick Mathewson
Also, avoid crashing when we attempt to double-remove an edge connection from the DNS resolver: just log a bug warning instead. Fixes bug 14129. Bugfix on 0d20fee2fbd48978, which was in 0.0.7rc1. jowr found the bug. cypherpunks wrote the fix. I added the log message and removed the assert.
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-09-02Another clang analyzer complaint wrt HT_GENERATENick Mathewson
We're calling mallocfn() and reallocfn() in the HT_GENERATE macro with the result of a product. But that makes any sane analyzer worry about overflow. This patch keeps HT_GENERATE having its old semantics, since we aren't the only project using ht.h. Instead, define a HT_GENERATE2 that takes a reallocarrayfn.
2014-05-06Fix compilation with DEBUG_DNS_CACHENick Mathewson
Reported by cypherpunks. Fix for #11761; bugfix on 0.2.3.13-alpha where we made ht.h stop using _identifiers.
2014-04-16Make sure everything using an interned string is preceded by a logNick Mathewson
(It's nice to know what we were about to rename before we died from renaming it.)
2014-04-08Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2014-04-07Fix a small memory leak when resolving PTR addressesNick Mathewson
Fixes bug 11437; bugfix on 0.2.4.7-alpha. Found by coverity; this is CID 1198198.
2014-02-12Siphash-2-4 is now our hash in nearly all cases.Nick Mathewson
I've made an exception for cases where I'm sure that users can't influence the inputs. This is likely to cause a slowdown somewhere, but it's safer to siphash everything and *then* look for cases to optimize. This patch doesn't actually get us any _benefit_ from siphash yet, since we don't really randomize the key at any point.
2013-09-19Fix compilation with libevent 1Nick Mathewson
a9910d89 added trickery to make us work with interned strings and seccomp; it requires libevent 2. Fix for 9785; bug not in any released tor.
2013-09-13Merge remote-tracking branch 'ctoader/gsoc-cap-stage2'Nick Mathewson
Conflicts: src/common/sandbox.c
2013-08-19finalised fix on libevent open string issueCristian Toader
2013-08-12attempt to add stat64 filename filters; failed due to getaddrinfo..Cristian Toader
2013-07-26Avoid assertion failure on unexepcted address family in DNS reply.Nick Mathewson
Fixes bug 9337; bugfix on 0.2.4.7-alpha.
2013-02-01Rename log() to tor_log() for loggingNick Mathewson
This is meant to avoid conflict with the built-in log() function in math.h. It resolves ticket 7599. First reported by dhill. This was generated with the following perl script: #!/usr/bin/perl -w -i -p s/\blog\(LOG_(ERR|WARN|NOTICE|INFO|DEBUG)\s*,\s*/log_\L$1\(/g; s/\blog\(/tor_log\(/g;
2013-01-16Aftermath of isin->contains renamingNick Mathewson
Fix wide lines and comments, and add a changes file
2013-01-16Rename *_isin to *_containsNick Mathewson
This is an automatically generated commit, from the following perl script, run with the options "-w -i -p". s/smartlist_string_num_isin/smartlist_contains_int_as_string/g; s/smartlist_string_isin((?:_case)?)/smartlist_contains_string$1/g; s/smartlist_digest_isin/smartlist_contains_digest/g; s/smartlist_isin/smartlist_contains/g; s/digestset_isin/digestset_contains/g;
2013-01-16Update the copyright date to 201.Nick Mathewson
2012-12-07Fix some wide linesNick Mathewson
2012-12-07Merge branch 'win64-7260'Nick Mathewson
Conflicts: src/or/dns.c
2012-11-15Remove some XXXX commens in dns.cNick Mathewson
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-14Make DNS resolve requests work for IPv6Nick Mathewson
* 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-14Fix a bug in policy_is_reject_star() that was making IPv4 exits breakNick Mathewson
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-14Add some missing doxygen for ipv6 exit codeNick Mathewson
2012-11-14Remove some unused defines in dns.cNick Mathewson
2012-11-14Repair DNS NEXIST hijacking workaroundNick Mathewson
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.