]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
commit my annotations while i was hunting down the host order bug
authorRoger Dingledine <arma@torproject.org>
Fri, 5 Mar 2010 21:04:01 +0000 (16:04 -0500)
committerRoger Dingledine <arma@torproject.org>
Fri, 5 Mar 2010 21:04:01 +0000 (16:04 -0500)
src/common/address.c
src/or/config.c
src/or/connection.c

index e51b7d8125105bcc0ab1b5f79c3698b18776a99a..4569373f3b926c83d6055ab357021c494cafe169 100644 (file)
@@ -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)
 {
index 6292f8f17d0044ad08f22591500fe47e1a6d4ba4..cbf9a5a0c691af5f262a082dd120046d6d2543a7 100644 (file)
@@ -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 &&
index 3747f2edf30358cfd60a1f066de26f9dd0d96502..7b1493bfc5421dc2e2146c31c7fd69f1208ac0dd 100644 (file)
@@ -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);