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

[or-cvs] r17789: {tor} get_interface_addr6(), and by extension get_interface_addr() (in tor/trunk: . src/common)



Author: nickm
Date: 2008-12-26 16:26:03 -0500 (Fri, 26 Dec 2008)
New Revision: 17789

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/common/address.c
Log:
get_interface_addr6(), and by extension get_interface_addr(), were pretty borked.  Copying a tor_addr_t from a sockaddr_storage using memcpy is a poor notion.

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2008-12-26 20:37:18 UTC (rev 17788)
+++ tor/trunk/ChangeLog	2008-12-26 21:26:03 UTC (rev 17789)
@@ -1,3 +1,9 @@
+Changes in version 0.2.1.10-alpha - 2009-??-??
+  o Minor bugfixes
+    - Make get_interface_address() function work properly again; stop
+      guessing the wrong parts of our address as our address.
+
+
 Changes in version 0.2.1.9-alpha - 2008-12-25
   o New directory authorities:
     - gabelmoo (the authority run by Karsten Loesing) now has a new

Modified: tor/trunk/src/common/address.c
===================================================================
--- tor/trunk/src/common/address.c	2008-12-26 20:37:18 UTC (rev 17788)
+++ tor/trunk/src/common/address.c	2008-12-26 21:26:03 UTC (rev 17789)
@@ -1088,7 +1088,7 @@
     goto err;
   }
 
-  memcpy(addr, &my_addr, sizeof(tor_addr_t));
+  tor_addr_from_sockaddr(addr, (struct sockaddr*)&my_addr, NULL);
   r=0;
  err:
   if (sock >= 0)