mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
commit my annotations while i was hunting down the host order bug
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
+4
-4
@@ -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 &&
|
||||
|
||||
+2
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user