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

[or-cvs] r11042: Fix compilation with HAVE_GETADDRINFO unset (in tor/trunk: . src/common)



Author: nickm
Date: 2007-08-03 03:57:31 -0400 (Fri, 03 Aug 2007)
New Revision: 11042

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/common/compat.c
Log:
 r13926@Kushana:  nickm | 2007-08-03 00:55:23 -0700
 Fix compilation with HAVE_GETADDRINFO unset



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r13926] on c95137ef-5f19-0410-b913-86e773d04f59

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-08-02 22:09:35 UTC (rev 11041)
+++ tor/trunk/ChangeLog	2007-08-03 07:57:31 UTC (rev 11042)
@@ -1,6 +1,8 @@
 Changes in version 0.2.0.5-alpha - 2007-??-??
   o Major bugfixes (compilation):
     - Try to fix win32 compilation again: Improve checking for ipv6 types.
+    - Fix compile on platforms without getaddrinfo: bug found by Li-Hui
+      Zhou.
 
   o Minor featuers (security):
     - Warn about unsafe ControlPort configurations.

Modified: tor/trunk/src/common/compat.c
===================================================================
--- tor/trunk/src/common/compat.c	2007-08-02 22:09:35 UTC (rev 11041)
+++ tor/trunk/src/common/compat.c	2007-08-03 07:57:31 UTC (rev 11042)
@@ -1128,11 +1128,11 @@
     if (ent) {
       addr->sa.sin_family = ent->h_addrtype;
       if (ent->h_addrtype == AF_INET) {
-        memcpy(addr->sa.sin_addr, ent->h_addr, sizeof(struct in_addr));
+        memcpy(&addr->sa.sin_addr, ent->h_addr, sizeof(struct in_addr));
       } else if (ent->h_addrtype == AF_INET6) {
-        memcpy(addr->sa.sin6_addr, ent->h_addr, sizeof(struct in6_addr));
+        memcpy(&addr->sa6.sin6_addr, ent->h_addr, sizeof(struct in6_addr));
       } else {
-        tor_assert(0)  /* gethostbyname() returned a bizarre addrtype */
+        tor_assert(0); /* gethostbyname() returned a bizarre addrtype */
       }
       return 0;
     }