Commit Graph

179 Commits

Author SHA1 Message Date
Nick Mathewson
c7910c3bc9 Consider GetNetworkParams() nameserver parsing to have suceeded if even one nameserver can be added. Log more useful info about what exactly is failing when we fail to add a nameserver.
svn:r17368
2008-11-22 21:46:34 +00:00
Nick Mathewson
0c9dfffe5a Implement the 0x20-hack to make DNS poisoning harder against us, especially when resolving large names. Add a cfg option to disable it, since apparently 3/10 of a percent of servers get it wrong.
svn:r17171
2008-10-29 19:20:02 +00:00
Roger Dingledine
bb1f488dbe fix typo in log entry
svn:r17050
2008-10-08 10:47:23 +00:00
Nick Mathewson
b0c48d8e45 Oops; we need to make sure that DNS request names are matched in the _questions_ section of the replies. Rejecting answers whether the _answers_ section did not match made us reject A records waiting at the end of a CNAME record. Bug 823.
svn:r16933
2008-09-22 20:06:25 +00:00
Nick Mathewson
c33dde4ac1 Fix mingw build with --enable-gcc-warnings set.
svn:r16759
2008-09-04 21:58:09 +00:00
Nick Mathewson
6bf1dec945 Oops; set address families on nameservers.
svn:r16674
2008-08-27 14:12:10 +00:00
Nick Mathewson
239cbe99ba Oops. Linux has no sa_len field.
svn:r16627
2008-08-22 18:00:26 +00:00
Nick Mathewson
fc52d85b7c r17846@tombo: nickm | 2008-08-22 11:54:00 -0400
Make dns resolver code more robust: handle nameservers with IPv6 addresses, make sure names in replies match requested names, make sure origin address of reply matches the address we asked.


svn:r16621
2008-08-22 16:24:43 +00:00
Nick Mathewson
e0de72dd87 r14410@tombo: nickm | 2008-02-23 16:51:46 -0500
Fix the last of the -Wshorten-64-to-32 warnings.


svn:r13696
2008-02-24 22:10:08 +00:00
Nick Mathewson
daefbfe691 r14371@tombo: nickm | 2008-02-21 16:13:18 -0500
Fix all -Wshorten-64-to-32 warnings that appear on my macbook.


svn:r13662
2008-02-21 21:15:31 +00:00
Nick Mathewson
5dd9d16b94 r18263@catbus: nickm | 2008-02-20 12:45:15 -0500
Oops. not supposed to use tor_assert() in eventdns.c


svn:r13622
2008-02-20 17:48:37 +00:00
Nick Mathewson
dc949b846a r18259@catbus: nickm | 2008-02-20 12:03:15 -0500
Make the last of the veracode warning issues get fixed.


svn:r13620
2008-02-20 17:03:16 +00:00
Nick Mathewson
418c2e1b6b r14181@tombo: nickm | 2008-02-15 16:48:17 -0500
Fix all but 2 DOCDOC items; defer many XXX020s (particularly those where fixing them would fix no bugs at the risk of introducing some bugs).


svn:r13529
2008-02-15 23:39:04 +00:00
Nick Mathewson
729555e1ca r17967@catbus: nickm | 2008-02-07 11:44:51 -0500
Fix some warnings identified by building with -D_FORTIFY_SOURCE=2.  Remove a redundant (and nuts) definition of _FORTIFY_SOURCE from eventdns.c.


svn:r13424
2008-02-08 21:09:29 +00:00
Nick Mathewson
92aaf68d19 r17914@catbus: nickm | 2008-02-05 16:12:16 -0500
Remove or downgrade some XXX020 items.


svn:r13388
2008-02-05 21:39:44 +00:00
Nick Mathewson
24aae484c9 r17624@catbus: nickm | 2008-01-15 00:42:01 -0500
Fixes to more anonymously-reported typos and logic errors.


svn:r13136
2008-01-15 05:57:19 +00:00
Nick Mathewson
3b8f76aa51 r17611@catbus: nickm | 2008-01-14 13:44:16 -0500
add some missing checks for failing return values.


svn:r13130
2008-01-14 19:00:23 +00:00
Nick Mathewson
5e81b0ecb8 r15170@catbus: nickm | 2007-09-19 11:41:50 -0400
Carry a new evdns function over from libevent: do not rely on compile-time code to set the transaction ID correctly.  This will be important when we finally drop our internal copy of eventdns.c


svn:r11517
2007-09-19 15:53:36 +00:00
Nick Mathewson
c0130f9611 r15022@catbus: nickm | 2007-09-10 10:31:54 -0400
remove yet more pointless differences between our eventdns.c and the evdns.c in libevent.


svn:r11425
2007-09-11 20:17:18 +00:00
Nick Mathewson
5828e4d5c4 r15020@catbus: nickm | 2007-09-10 10:22:31 -0400
remove more pointless differences between our eventdns.c and the evdns.c in libevent.


svn:r11416
2007-09-10 14:23:26 +00:00
Nick Mathewson
13b65c4129 r15018@catbus: nickm | 2007-09-10 10:04:16 -0400
Change comments in eventdns.c to C-style, so we can more easily diff it against the version in libevent to reconcile them (again).


svn:r11415
2007-09-10 14:05:12 +00:00
Nick Mathewson
615d19fe4c r15001@catbus: nickm | 2007-09-10 09:44:49 -0400
Fix a couple of memory leaks in eventdns.c; found by niels.  Not backport candidates, since they only affect DNSPort users.


svn:r11413
2007-09-10 13:48:01 +00:00
Nick Mathewson
1f244d3943 r14639@catbus: nickm | 2007-08-17 17:45:28 -0400
Compile without warnings on MinGW, even with --enable-gcc-warnings enabled.


svn:r11157
2007-08-17 21:46:34 +00:00
Nick Mathewson
3fc04529d4 r14093@catbus: nickm | 2007-08-08 01:49:54 -0400
Include fewer redundant headers; use the compiler search paths better.


svn:r11060
2007-08-08 05:50:31 +00:00
Nick Mathewson
2305c2c7be r13903@catbus: nickm | 2007-07-25 18:03:56 -0400
Make buffer large enough to hold ip6.arpa addresses.  This code was not actually used yet, so no user-visible bug existed. (Based on patch by croup.)


svn:r10928
2007-07-25 22:56:47 +00:00
Nick Mathewson
1b24067395 r13773@kushana: nickm | 2007-07-23 00:16:44 -0400
Use tor malloc replacements in eventdns.c for now: there might be goblins there...goblins that only dmalloc can find!


svn:r10912
2007-07-23 04:18:20 +00:00
Nick Mathewson
a1f4644a94 r13840@catbus: nickm | 2007-07-19 16:00:43 -0400
Apparently, this problem can occur on the whole BSD family. "Yay."


svn:r10884
2007-07-19 20:00:45 +00:00
Nick Mathewson
99792df645 r13473@catbus: nickm | 2007-06-17 13:42:36 -0400
Fix solaris eventdns.c behavior.  This time, I think I got it.  We were redefining _FILE_OFFSET_BITS, and thereby calling fstat64() on a struct stat, or something like that.


svn:r10643
2007-06-17 17:43:25 +00:00
Nick Mathewson
3b4fa59b60 r13117@catbus: nickm | 2007-05-31 19:40:32 -0400
Patch from Tup: treat RESOLVED_TYPE_ERROR_TRANSIENT as a SERVERFAILED, and RESOLVED_TYPE_ERROR as NOTEXIST.  Generate transient/nontransient errors more sensibly.  Set flags better on DNS replies.


svn:r10427
2007-05-31 23:40:35 +00:00
Nick Mathewson
4cd93bd9ec r13071@catbus: nickm | 2007-05-29 15:54:46 -0400
Aaargh.  Revert accidentally-committed debugging code in last patch.


svn:r10400
2007-05-29 19:54:54 +00:00
Nick Mathewson
1359871c14 r13070@catbus: nickm | 2007-05-29 15:53:21 -0400
Fix handling of resolves with very long or otherwise malformed addresses, and comment dns_resolve better, and stop making what should be a BUG warning into an assert(0).  This fixes bug 427, which was introduced around 9900/9931/9932.  Not a backport candidate: 0.1.2.x never had this bug.


svn:r10399
2007-05-29 19:54:51 +00:00
Nick Mathewson
d509efb9b7 r13019@catbus: nickm | 2007-05-27 12:32:55 -0400
Merge an evdns fix from libevent r357: "evdns_shutdown fix from adam langley.


svn:r10387
2007-05-29 14:41:16 +00:00
Nick Mathewson
b0be93c8b0 r12988@catbus: nickm | 2007-05-25 20:15:56 -0400
socklen_t is a silly type anyway. Just use int as the argument for evdns_server_request_get_requesting_addr.


svn:r10347
2007-05-26 00:15:58 +00:00
Nick Mathewson
17830bc03b r12941@catbus: nickm | 2007-05-24 16:25:00 -0400
Fix some eventdns dns server bugs, and add a new eventdns function to get the address of whoever requested this lookup.


svn:r10316
2007-05-24 20:31:27 +00:00
Nick Mathewson
de5194eeaa r13025@Kushana: nickm | 2007-05-21 17:40:56 -0400
Bugfix and possible backport candidate: use the same logic as in read_all when reading resolv.conf.  Maybe this fixes bug 433.


svn:r10237
2007-05-21 21:48:02 +00:00
Nick Mathewson
b837191fd0 r12768@catbus: nickm | 2007-05-16 17:25:33 -0400
Fix GCC warnings related to local parameters/variables getting shadowed.


svn:r10198
2007-05-16 22:15:14 +00:00
Nick Mathewson
f2db099fc0 r12571@catbus: nickm | 2007-04-30 10:51:52 -0400
Check for more HAVE_* header defines when building eventdns.c


svn:r10063
2007-04-30 14:52:07 +00:00
Nick Mathewson
f38240435a r12001@catbus: nickm | 2007-02-28 15:24:12 -0500
Try to build without warnings on mingw with verbose warnings on.  First attempt.


svn:r9688
2007-02-28 20:24:27 +00:00
Nick Mathewson
3008c3b768 r12000@catbus: nickm | 2007-02-28 15:12:21 -0500
Try to fix eventdns bug 326 again, this time by noting that rcode 2 (serverfailed) does not really mean "The server is useless."


svn:r9687
2007-02-28 20:24:23 +00:00
Nick Mathewson
cc64d1f111 r11917@catbus: nickm | 2007-02-24 03:18:52 -0500
Fix another XXX012 in eventdns.c: tell the DNS request about malformed DNS replies.


svn:r9637
2007-02-24 08:18:59 +00:00
Nick Mathewson
8507699256 r11624@catbus: nickm | 2007-02-01 13:17:35 -0500
Note a few questionable bits pointed out by RATS.  (And no, RATS, I'm not about to stop having fixed-sized local buffers for you.  I know how to use them, thankyouverymuch.)


svn:r9474
2007-02-01 18:33:02 +00:00
Nick Mathewson
cd374f810c r11586@catbus: nickm | 2007-01-29 13:13:27 -0500
Add a couple of fixes I turned up while writing regression tests for libevent: Allow DNS servers on ports other than 53, and handle TTLs correctly on reverse hostname lookups.


svn:r9458
2007-01-29 18:13:42 +00:00
Nick Mathewson
152547be49 r11548@catbus: nickm | 2007-01-27 00:15:47 -0500
Fix two assert bugs encountered when trying ipv6 lookups with eventdns code.


svn:r9430
2007-01-27 05:15:53 +00:00
Nick Mathewson
e0ae28d0cd r9701@catbus: nickm | 2007-01-21 13:21:25 -0500
Detect and reject another (harmless) class of DNS replies.  Also, fix a couple of IPv6 bugs in evendns.c


svn:r9379
2007-01-21 18:21:39 +00:00
Nick Mathewson
ff62a4d91b r9692@catbus: nickm | 2007-01-21 12:04:22 -0500
Detect pointer loops in DNS requests and replies; avoid infinite loop on such malformed replies.  Fixes bug 380.


svn:r9378
2007-01-21 17:05:10 +00:00
Nick Mathewson
093d71762c r11978@Kushana: nickm | 2007-01-15 18:54:25 -0500
Apparently, the OpenBSD linker thinks it knows C better than I do, and gets to call me names for having strcat and strcpy and sprintf in my code--whether I use them safely or not.  All right, OpenBSD.  You win... this round.


svn:r9360
2007-01-15 23:56:38 +00:00
Nick Mathewson
9937695598 r11919@Kushana: nickm | 2007-01-10 13:32:48 -0500
Add some defensive programming to eventdns.c in an attempt to catch possible memory stomping bugs.


svn:r9322
2007-01-10 19:49:21 +00:00
Nick Mathewson
135aed5670 r11850@Kushana: nickm | 2007-01-05 17:12:08 -0500
Look in netinet/in6.h header when looking for struct in6_addr. (Issue found by saeftl.)


svn:r9272
2007-01-05 22:12:15 +00:00
Andrew Lewman
4f565b73ef Fix formatting in eventdns.c. Remove the rest of the osx binary
uninstaller.


svn:r9235
2007-01-02 06:26:42 +00:00
Nick Mathewson
b59573949e r11736@Kushana: nickm | 2006-12-28 17:46:23 -0500
Mark a pile of XXXX comments as targetted for 0.1.2: some because they look important, some because they look easy.


svn:r9205
2006-12-29 02:47:51 +00:00
Nick Mathewson
3996fd1d9d r11726@Kushana: nickm | 2006-12-28 16:24:06 -0500
Expose a function from eventdns.c to set options without having to make a fake configuration file.  Also, add more settable options


svn:r9202
2006-12-28 21:29:31 +00:00
Nick Mathewson
baadf35c63 r11646@Kushana: nickm | 2006-12-19 14:40:38 -0500
Resolve bug 363: do not fall back to 127.0.0.1 when no nameservers are configured.  Instead, have the admin fix resolv.conf or configure a nameserver.


svn:r9157
2006-12-19 19:49:03 +00:00
Nick Mathewson
973baa1673 r11630@Kushana: nickm | 2006-12-17 22:02:24 -0500
Add a typedef to (try to) make eventdns work on mingw.  Man, I need a buildbot for this.


svn:r9147
2006-12-18 03:02:30 +00:00
Roger Dingledine
2ae9615a0b take the broken obsolete url out again.
seriously, this line should stay out.
how can we make this happen?


svn:r9119
2006-12-15 06:22:52 +00:00
Nick Mathewson
62f711fcf3 r11585@Kushana: nickm | 2006-12-15 01:11:49 -0500
Tabify eventdns so that it matches libevent house style.


svn:r9118
2006-12-15 06:12:14 +00:00
Nick Mathewson
b16aa6412e r11584@Kushana: nickm | 2006-12-15 01:10:45 -0500
Try to reconcile (except for whitespace) eventdns with version in libevent, so it is easier for me to send merges.  These changes should be cosmetic. (Ha!)


svn:r9117
2006-12-15 06:12:01 +00:00
Roger Dingledine
7217f3ca47 couldn't handle leaving this typo in
svn:r9094
2006-12-12 20:20:48 +00:00
Nick Mathewson
9fa707f5d3 r11552@Kushana: nickm | 2006-12-12 13:34:13 -0500
fix a signed/unsigned comparison in eventdns.c


svn:r9092
2006-12-12 18:34:22 +00:00
Nick Mathewson
a3a00df69d r11548@Kushana: nickm | 2006-12-12 00:44:51 -0500
Merge whitespace and other changes from libevent


svn:r9090
2006-12-12 05:45:19 +00:00
Nick Mathewson
494e45482a r11536@Kushana: nickm | 2006-12-11 22:48:21 -0500
Add ipv6 functionality to evdns.


svn:r9089
2006-12-12 03:48:46 +00:00
Nick Mathewson
35d92f8245 r11498@Kushana: nickm | 2006-12-11 21:40:24 -0500
Document all structures and (non-exported) functions.  External documentation will probably wind up being a manpage, hopefully written by somebody else.


svn:r9087
2006-12-12 02:57:02 +00:00
Nick Mathewson
097aec8e9d r11497@Kushana: nickm | 2006-12-11 21:17:45 -0500
Rename nameserver functions: every one should now have "server" in the name.


svn:r9086
2006-12-12 02:56:54 +00:00
Nick Mathewson
707429e9a3 r11496@Kushana: nickm | 2006-12-11 19:39:37 -0500
Clean up XXXX comments in evdns code.  Make server_ports actually go away when their refcnt reaches zero.


svn:r9085
2006-12-12 02:56:47 +00:00
Nick Mathewson
d22deb61d6 r11495@Kushana: nickm | 2006-12-11 19:11:14 -0500
More evdns: tab fixes.  Dont make users worry about flags.  Set truncated flag correctly when generating responses, rather than just bailing out.


svn:r9084
2006-12-12 02:56:41 +00:00
Nick Mathewson
abc1304aef r11494@Kushana: nickm | 2006-12-11 14:50:20 -0500
Export DNS types and classes in eventdns.h so that server code can use them.


svn:r9083
2006-12-12 02:56:35 +00:00
Nick Mathewson
fc125b1ef4 r11493@Kushana: nickm | 2006-12-11 14:28:42 -0500
Oops; apparently DNS replies are supposed to include the questions.  Revise "add_ptr_reply" to accept an inaddr_arpa name instead of just the sockaddr_in. Also, add a "-servertest" function to the test code to see whether the DNS server logic is working.


svn:r9082
2006-12-12 02:56:28 +00:00
Nick Mathewson
e53bca15e7 r11492@Kushana: nickm | 2006-12-11 12:30:23 -0500
Implement dns server reply retry logic.


svn:r9081
2006-12-12 02:56:23 +00:00
Nick Mathewson
c58d9494df r11491@Kushana: nickm | 2006-12-11 12:12:57 -0500
More DNS server hacking: everything except testing, and retries, and documentation, and Tor integration.


svn:r9080
2006-12-12 02:56:20 +00:00
Nick Mathewson
991308fac9 svn:r9079 2006-12-12 02:56:17 +00:00
Nick Mathewson
ff029a635d svn:r9077 2006-12-12 02:54:48 +00:00
Nick Mathewson
e190acf780 r9254@Kushana: nickm | 2006-10-17 17:23:36 -0400
Implement dns label compression.  Clients do not need this much; dns servers definitely do.


svn:r9073
2006-12-12 02:50:17 +00:00
Nick Mathewson
e9d67b1162 r9099@Kushana: nickm | 2006-10-05 17:42:55 -0400
start fleshing out some logic to build server support into eventdns.  Still needs work and testing.


svn:r9068
2006-12-12 02:49:45 +00:00
Nick Mathewson
81be0ad1e5 r11486@Kushana: nickm | 2006-12-08 00:58:47 -0500
Fix a longstanding bug in eventdns related to timeouts:  The timeout count was never actually reset to 0.  Argh.  Now we reset it to zero after we get a successful request, or after we notice that a nameserver is back up, or after we decide the nameserver is down because of timeouts.  This may fix bug 326.


svn:r9054
2006-12-08 05:59:21 +00:00
Nick Mathewson
9243e54177 r9313@totoro: nickm | 2006-11-13 20:07:41 -0500
Try to compile with fewer warnings on irix64's MIPSpro compiler /
 environment, which apparently believes that:
   - off_t can be bigger than size_t.
   - only mean kids assign things they do not subsequently inspect.
 
 I don't try to fix the "error" that makes it say:
 
 cc-3970 cc: WARNING File = main.c, Line = 1277
   conversion from pointer to same-sized integral type (potential portability
           problem)
 
     uintptr_t sig = (uintptr_t)arg;
 
 Because really, what can you do about a compiler that claims to be c99
 but doesn't understand that void* x = NULL; uintptr_t y = (uintptr_t) x;
 is safe?
 


svn:r8948
2006-11-14 01:07:52 +00:00
Nick Mathewson
97e17d817b r8985@totoro: nickm | 2006-10-10 19:39:57 -0400
Fix a signed/unsigned compare in eventdns.c


svn:r8685
2006-10-10 23:46:33 +00:00
Nick Mathewson
d1c8fd9759 r8947@totoro: nickm | 2006-10-08 17:04:30 -0400
Fix signed/unsigned compare warning in eventdns.c


svn:r8654
2006-10-08 21:05:06 +00:00
Andrew Lewman
5227531744 Remove spurious void which causes builds to fail in mingw.
svn:r8650
2006-10-08 18:44:02 +00:00
Roger Dingledine
b6e590a1a5 reapply a patch from adam langley that got clobbered when
nick merged something back in


svn:r8605
2006-10-06 06:46:08 +00:00
Nick Mathewson
c15dc2d94c r9101@Kushana: nickm | 2006-10-05 23:05:11 -0400
Trivial fix for solaris build.  Libevent will want to use its own fix here, and probably already has.


svn:r8601
2006-10-06 03:05:19 +00:00
Nick Mathewson
4767d533f7 r9097@Kushana: nickm | 2006-10-05 14:51:57 -0400
Make eventdns.c formatting a little closer to evdns.c in libevent; add some bulletproofing to APPEND16 macro; clean some messages.


svn:r8600
2006-10-05 19:22:26 +00:00
Nick Mathewson
fc9dd98d4c r8805@totoro: nickm | 2006-09-30 16:07:13 -0400
Oops; nameserver list is circular.


svn:r8552
2006-09-30 20:07:37 +00:00
Nick Mathewson
b21e656eaf r9007@Kushana: nickm | 2006-09-29 13:17:32 -0400
Make eventdns give strings for DNS errors, not just error numbers.


svn:r8535
2006-09-29 18:13:33 +00:00
Nick Mathewson
ba7868c7b3 r8969@Kushana: nickm | 2006-09-26 18:00:36 -0400
Remove a signed/unsigned comparison in eventdns.c


svn:r8508
2006-09-26 22:03:26 +00:00
Nick Mathewson
01f9e97d43 Minor fix: add code to eventdns so it can free memory on shutdown. This should help valgrind and dmalloc freak out less.
svn:r8503
2006-09-25 20:38:58 +00:00
Nick Mathewson
11b4296b0b Marge changes from libevent evdns to our eventdns. Most are cosmetic, but one or two are stability-related. This should make it easier to push our changes back towards libevent.
svn:r8482
2006-09-24 17:52:23 +00:00
Roger Dingledine
e9abe750ea eventdns patch from Adam Langley
svn:r8429
2006-09-19 21:37:03 +00:00
Nick Mathewson
4bc42f4c18 Fix a bogus free() in eventdns.c. Bug reported by xiando.
svn:r8428
2006-09-19 20:45:20 +00:00
Mike Chiussi
f9f281251b another typo
svn:r8351
2006-09-08 09:05:07 +00:00
Mike Chiussi
1ee88bb01a fixed typo in eventdns.c
svn:r8350
2006-09-08 09:02:14 +00:00
Nick Mathewson
8a12d9ae2e r8755@Kushana: nickm | 2006-09-07 12:31:57 -0400
Tabify eventdns


svn:r8348
2006-09-07 16:32:06 +00:00
Nick Mathewson
4246490b81 r8753@Kushana: nickm | 2006-09-07 12:23:25 -0400
Make eventdns spacing consistant


svn:r8347
2006-09-07 16:24:19 +00:00
Mike Chiussi
b931994c6a fixed win32 eventdns snafu
svn:r8345
2006-09-07 06:34:20 +00:00
Mike Chiussi
c40acb86f4 - got rid of tabs
svn:r8344
2006-09-07 04:02:52 +00:00
Mike Chiussi
3c85780e69 - got rid of tabs (i think)
svn:r8343
2006-09-07 03:58:46 +00:00
Mike Chiussi
5af47d1641 - added some debugging lines to load_nameservers_from_registry()
svn:r8342
2006-09-07 03:53:14 +00:00
Mike Chiussi
879fe91d88 rm'ed a tab (sorry)
svn:r8333
2006-09-07 00:54:28 +00:00
Mike Chiussi
91d7ad660f - fixed up typos in eventdns.c
- configure lets user build with eventdns on win32


svn:r8332
2006-09-07 00:51:20 +00:00
Nick Mathewson
7ed528c5c5 r8733@Kushana: nickm | 2006-09-06 17:35:22 -0400
Add some missing defines to eventdns.c for windows.


svn:r8330
2006-09-06 21:35:30 +00:00
Nick Mathewson
1e26233957 r8731@Kushana: nickm | 2006-09-06 16:33:19 -0400
Try to fix eventdns.c build on windows.


svn:r8329
2006-09-06 20:33:28 +00:00
Nick Mathewson
b40e639f15 r8708@Kushana: nickm | 2006-09-02 20:34:15 -0400
Fix warnings reported by weasel when compiling Tor on Debian woody.


svn:r8318
2006-09-03 02:13:52 +00:00