aboutsummaryrefslogtreecommitdiff
path: root/src/lib/net/address.h
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2020-04-15 13:04:33 +1000
committerteor <teor@torproject.org>2020-04-29 22:43:09 +1000
commit16f3f6a1afe5dcd75536039029f51392d05ce153 (patch)
tree7cd61d102c36ad8461fa6aad3b3b2a1e97039cb7 /src/lib/net/address.h
parentec5f4f3c5a5aa4d69b2867ba41bc83ba1e6c888a (diff)
downloadtor-16f3f6a1afe5dcd75536039029f51392d05ce153.tar.gz
tor-16f3f6a1afe5dcd75536039029f51392d05ce153.zip
relay/circuitbuild: Re-use IPv6 connections for circuits
Search for existing connections using the remote IPv4 and IPv6 addresses. Part of 33817.
Diffstat (limited to 'src/lib/net/address.h')
-rw-r--r--src/lib/net/address.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/net/address.h b/src/lib/net/address.h
index 611d1ca1ee..651d6bc714 100644
--- a/src/lib/net/address.h
+++ b/src/lib/net/address.h
@@ -104,6 +104,10 @@ int tor_addr_from_sockaddr(tor_addr_t *a, const struct sockaddr *sa,
uint16_t *port_out);
void tor_addr_make_unspec(tor_addr_t *a);
void tor_addr_make_null(tor_addr_t *a, sa_family_t family);
+#define tor_addr_port_make_null(addr, port, family) \
+ (void)(tor_addr_make_null(addr, family), (port) = 0)
+#define tor_addr_port_make_null_ap(ap, family) \
+ tor_addr_port_make_null(&(ap)->addr, (ap)->port, family)
char *tor_sockaddr_to_str(const struct sockaddr *sa);
/** Return an in6_addr* equivalent to <b>a</b>, or NULL if <b>a</b> is not