[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: Wanted: Brave, hacker, exit node operator



Hi Adam,

> The patch is at http://www.imperialviolet.org/binary/tor-cvs-eventdns.agl.patch
> and you need to drop the following two files into src/or/:
> http://www.imperialviolet.org/binary/eventdns.c
> http://www.imperialviolet.org/binary/eventdns.h

I applied the patch against CVS from 15 minutes ago, but got an error
and some warnings:

===
alan:tor $ patch -p0 < tor-cvs-eventdns.agl.patch 
patching file configure.in
patching file src/or/Makefile.am
patching file src/or/dns.c
Hunk #3 FAILED at 73.
Hunk #4 succeeded at 330 (offset 9 lines).
Hunk #5 succeeded at 381 with fuzz 2 (offset 14 lines).
Hunk #6 succeeded at 554 (offset 14 lines).
Hunk #7 succeeded at 566 (offset 14 lines).
Hunk #8 succeeded at 580 (offset 14 lines).
Hunk #9 succeeded at 604 (offset 14 lines).
Hunk #10 succeeded at 662 (offset 14 lines).
Hunk #11 succeeded at 963 with fuzz 1 (offset 17 lines).
1 out of 11 hunks FAILED -- saving rejects to file src/or/dns.c.rej
===

Here is src/or/dns.c.rej:

===
***************
*** 68,79 ****
  } cached_resolve_t;
  
  static void purge_expired_resolves(uint32_t now);
- static int assign_to_dnsworker(connection_t *exitconn);
  static void dns_purge_resolve(cached_resolve_t *resolve);
  static void dns_found_answer(char *address, uint32_t addr, char outcome);
  static int dnsworker_main(void *data);
  static int spawn_dnsworker(void);
  static void spawn_enough_dnsworkers(void);
  static void send_resolved_cell(connection_t *conn, uint8_t answer_type);
  
  /** Splay tree of cached_resolve objects. */
--- 73,88 ----
  } cached_resolve_t;
  
  static void purge_expired_resolves(uint32_t now);
  static void dns_purge_resolve(cached_resolve_t *resolve);
+ #ifndef EVENTDNS
+ static int assign_to_dnsworker(connection_t *exitconn);
  static void dns_found_answer(char *address, uint32_t addr, char outcome);
  static int dnsworker_main(void *data); static int spawn_dnsworker(void);
  static void spawn_enough_dnsworkers(void);
+ #else
+ static int eventdns_submit(connection_t *exitconn);
+ #endif
  static void send_resolved_cell(connection_t *conn, uint8_t answer_type);
  
  /** Splay tree of cached_resolve objects. */
===

I applied the patch by hand since it's obviously simple. I don't know
why it failed.

> The patch applies against the CVS tree at the moment. You need to
> rerun autogen.sh afterwards and run ./configure --enable-eventdns.

I did this and recompiled:

===
eventdns.c:229: warning: redefinition of `u_char'
/usr/include/sys/types.h:35: warning: `u_char' previously declared here
eventdns.c:230: warning: redefinition of `uint'
/usr/include/sys/types.h:153: warning: `uint' previously declared here
eventdns.c: In function `search_set_from_hostname':
eventdns.c:1271: error: `HOST_NAME_MAX' undeclared (first use in this function)
eventdns.c:1271: error: (Each undeclared identifier is reported only once
eventdns.c:1271: error: for each function it appears in.)
eventdns.c:1271: warning: unused variable `hostname'
make[3]: *** [eventdns.o] Error 1
make[3]: Leaving directory `/home/chris/src/tor/src/or'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/chris/src/tor/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/chris/src/tor'
make: *** [all-recursive-am] Error 2
===


-- 
http://www.eff.org/about/staff/#chris_palmer

Attachment: pgpEoLu1lpeZS.pgp
Description: PGP signature