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

[or-cvs] [tor/master] commit my annotations while i was hunting down the host order bug



Author: Roger Dingledine <arma@xxxxxxxxxxxxxx>
Date: Fri, 5 Mar 2010 16:04:01 -0500
Subject: commit my annotations while i was hunting down the host order bug
Commit: 625963d92a3457470cd5097051fddd00a6b5e04c

---
 src/common/address.c |    2 +-
 src/or/config.c      |    8 ++++----
 src/or/connection.c  |    4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/common/address.c b/src/common/address.c
index e51b7d8..4569373 100644
--- a/src/common/address.c
+++ b/src/common/address.c
@@ -726,7 +726,7 @@ tor_addr_is_loopback(const tor_addr_t *addr)
 }
 
 /** Set <b>dest</b> to equal the IPv4 address in <b>v4addr</b> (given in
- * network order. */
+ * network order). */
 void
 tor_addr_from_ipv4n(tor_addr_t *dest, uint32_t v4addr)
 {
diff --git a/src/or/config.c b/src/or/config.c
index 6292f8f..cbf9a5a 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -2191,7 +2191,7 @@ resolve_my_address(int warn_severity, or_options_t *options,
                    uint32_t *addr_out, char **hostname_out)
 {
   struct in_addr in;
-  uint32_t addr;
+  uint32_t addr; /* host order */
   char hostname[256];
   int explicit_ip=1;
   int explicit_hostname=1;
@@ -2221,8 +2221,8 @@ resolve_my_address(int warn_severity, or_options_t *options,
   if (tor_inet_aton(hostname, &in) == 0) {
     /* then we have to resolve it */
     explicit_ip = 0;
-    if (tor_lookup_hostname(hostname, &addr)) {
-      uint32_t interface_ip;
+    if (tor_lookup_hostname(hostname, &addr)) { /* failed to resolve */
+      uint32_t interface_ip; /* host order */
 
       if (explicit_hostname) {
         log_fn(warn_severity, LD_CONFIG,
@@ -2243,7 +2243,7 @@ resolve_my_address(int warn_severity, or_options_t *options,
       log_fn(notice_severity, LD_CONFIG, "Learned IP address '%s' for "
              "local interface. Using that.", tmpbuf);
       strlcpy(hostname, "<guessed from interfaces>", sizeof(hostname));
-    } else {
+    } else { /* resolved hostname into addr */
       in.s_addr = htonl(addr);
 
       if (!explicit_hostname &&
diff --git a/src/or/connection.c b/src/or/connection.c
index 3747f2e..7b1493b 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -3095,10 +3095,10 @@ alloc_http_authenticator(const char *authenticator)
 static void
 client_check_address_changed(int sock)
 {
-  uint32_t iface_ip, ip_out;
+  uint32_t iface_ip, ip_out; /* host order */
   struct sockaddr_in out_addr;
   socklen_t out_addr_len = (socklen_t) sizeof(out_addr);
-  uint32_t *ip;
+  uint32_t *ip; /* host order */
 
   if (!last_interface_ip)
     get_interface_address(LOG_INFO, &last_interface_ip);
-- 
1.6.5