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

patch to resolve task 132



Please consider this patch, which appears to resolve task 132.

Geoff

Only in or.patch: .routerlist.c.swp
Only in or: CVS
diff -u or/connection_edge.c or.patch/connection_edge.c
--- or/connection_edge.c	2005-05-07 01:55:06.000000000 -0400
+++ or.patch/connection_edge.c	2005-05-09 14:51:25.000000000 -0400
@@ -914,6 +914,19 @@
   if (addresstype == EXIT_HOSTNAME) {
     /* .exit -- modify conn to specify the exit node. */
     char *s = strrchr(socks->address,'.');
+    if (!s) {
+      struct in_addr in;
+      char *orig = tor_strdup(socks->address);
+      routerinfo_t *r = router_get_by_nickname(socks->address);
+
+      if(r) {
+        in.s_addr = htonl(r->addr);
+        strlcpy(socks->address, inet_ntoa(in), sizeof(socks->address));
+        strlcat(socks->address, ".", sizeof(socks->address));
+        strlcat(socks->address, orig, sizeof(socks->address));
+        s = strrchr(socks->address,'.');
+      }
+    }
     if (!s || s[1] == '\0') {
       log_fn(LOG_WARN,"Malformed exit address '%s'. Refusing.",
              safe_str(socks->address));
Only in or.patch: connection_edge.c~

Attachment: signature.asc
Description: Digital signature