diff options
author | rl1987 <rl1987@sdf.lonestar.org> | 2015-03-14 20:20:50 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-03-31 14:37:02 -0400 |
commit | a4f89e21a6df0785f7e7714a7bf64d32f388e380 (patch) | |
tree | 58982c70653afa719f223257768b9c8d9b36880c /src/common/address.c | |
parent | c03493ad138c024339ff78cb33e22d949c0282a8 (diff) | |
download | tor-a4f89e21a6df0785f7e7714a7bf64d32f388e380.tar.gz tor-a4f89e21a6df0785f7e7714a7bf64d32f388e380.zip |
Whitebox test for get_interface_address6_via_udp_socket_hack().
Also, fix some whitespace mishaps.
Diffstat (limited to 'src/common/address.c')
-rw-r--r-- | src/common/address.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/address.c b/src/common/address.c index 3e26576815..e4aad436fb 100644 --- a/src/common/address.c +++ b/src/common/address.c @@ -1529,13 +1529,14 @@ get_interface_address6_via_udp_socket_hack(int severity, goto err; } - if (connect(sock,(struct sockaddr *)&target_addr, addr_len) < 0) { + if (tor_connect_socket(sock,(struct sockaddr *)&target_addr, + addr_len) < 0) { int e = tor_socket_errno(sock); log_fn(severity, LD_NET, "connect() failed: %s", tor_socket_strerror(e)); goto err; } - if (getsockname(sock,(struct sockaddr*)&my_addr, &addr_len)) { + if (tor_getsockname(sock,(struct sockaddr*)&my_addr, &addr_len)) { int e = tor_socket_errno(sock); log_fn(severity, LD_NET, "getsockname() to determine interface failed: %s", tor_socket_strerror(e)); @@ -1546,8 +1547,7 @@ get_interface_address6_via_udp_socket_hack(int severity, if (tor_addr_is_loopback(addr) || tor_addr_is_multicast(addr)) { log_fn(severity, LD_NET, "Address that we determined via UDP socket" " magic is unsuitable for public comms."); - } - else { + } else { r=0; } } |