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

[or-cvs] r16474: {tor} Try once again to make BSD compilation happy. (in tor/trunk/src: common or)



Author: nickm
Date: 2008-08-08 08:58:17 -0400 (Fri, 08 Aug 2008)
New Revision: 16474

Modified:
   tor/trunk/src/common/address.c
   tor/trunk/src/common/address.h
   tor/trunk/src/or/connection_edge.c
Log:
Try once again to make BSD compilation happy.

Modified: tor/trunk/src/common/address.c
===================================================================
--- tor/trunk/src/common/address.c	2008-08-08 04:06:54 UTC (rev 16473)
+++ tor/trunk/src/common/address.c	2008-08-08 12:58:17 UTC (rev 16474)
@@ -635,6 +635,13 @@
   memcpy(dest->addr.in6_addr.s6_addr, ipv6_bytes, 16);
 }
 
+/** DOCDOC */
+void
+tor_addr_from_in6(tor_addr_t *dest, const struct in6_addr *in6)
+{
+  tor_addr_from_ipv6_bytes(dest, (const char*)in6->s6_addr);
+}
+
 /** Copy a tor_addr_t from <b>src</b> to <b>dest</b>.
  */
 void

Modified: tor/trunk/src/common/address.h
===================================================================
--- tor/trunk/src/common/address.h	2008-08-08 04:06:54 UTC (rev 16473)
+++ tor/trunk/src/common/address.h	2008-08-08 12:58:17 UTC (rev 16474)
@@ -127,7 +127,8 @@
  * order. */
 #define tor_addr_from_ipv4h(dest, v4addr)       \
   tor_addr_from_ipv4n((dest), htonl(v4addr))
-void tor_addr_from_ipv6_bytes(tor_addr_t *dest, const char *byets);
+void tor_addr_from_ipv6_bytes(tor_addr_t *dest, const char *bytes);
+void tor_addr_from_in6(tor_addr_t *dest, const struct in6_addr *in6);
 int tor_addr_is_null(const tor_addr_t *addr);
 int tor_addr_is_loopback(const tor_addr_t *addr);
 

Modified: tor/trunk/src/or/connection_edge.c
===================================================================
--- tor/trunk/src/or/connection_edge.c	2008-08-08 04:06:54 UTC (rev 16473)
+++ tor/trunk/src/or/connection_edge.c	2008-08-08 12:58:17 UTC (rev 16474)
@@ -1762,13 +1762,13 @@
   if (pnl.af == AF_INET) {
     tor_addr_from_ipv4n(&addr, pnl.rdaddr.v4.s_addr);
   } else if (pnl.af == AF_INET6) {
-    tor_addr_from_ipv6_bytes(&addr, pnl.rdaddr.v6.s6_addr);
+    tor_addr_from_in6(&addr, &pnl.rdaddr.v6);
   } else {
     tor_fragile_assert();
     return -1;
   }
 
-  tor_addr_to_string(req->address, &addr, sizeof(req->address), 0);
+  tor_addr_to_str(req->address, &addr, sizeof(req->address), 0);
   req->port = ntohs(pnl.rdport);
 
   return 0;