diff options
author | Linus Nordberg <linus@torproject.org> | 2012-08-14 14:03:58 +0200 |
---|---|---|
committer | Linus Nordberg <linus@torproject.org> | 2012-08-20 17:01:18 +0200 |
commit | 9216e2819b563d3e519b131a7ec34b3ddc196e25 (patch) | |
tree | 96a096c99ed9087cdd849a60e74d6750e60de0a7 | |
parent | 661bd3fe714f0c9986eb872eb8eb5d72b2efc195 (diff) | |
download | tor-9216e2819b563d3e519b131a7ec34b3ddc196e25.tar.gz tor-9216e2819b563d3e519b131a7ec34b3ddc196e25.zip |
Send IPv6 address in NETINFO cells.
Closes #6364.
-rw-r--r-- | changes/bug6364 | 3 | ||||
-rw-r--r-- | src/or/connection_or.c | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/changes/bug6364 b/changes/bug6364 new file mode 100644 index 0000000000..c0eb453959 --- /dev/null +++ b/changes/bug6364 @@ -0,0 +1,3 @@ + o Minor features: + - A relay with an IPv6 OR port now sends that address in NETINFO + cells. Fix for bug 6364. diff --git a/src/or/connection_or.c b/src/or/connection_or.c index 55ea32e57b..da27cba32d 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -1988,12 +1988,19 @@ connection_or_send_netinfo(or_connection_t *conn) if ((public_server_mode(get_options()) || !conn->is_outgoing) && (me = router_get_my_routerinfo())) { tor_addr_t my_addr; - *out++ = 1; /* only one address is supported. */ + *out++ = 1 + !tor_addr_is_null(&me->ipv6_addr); tor_addr_from_ipv4h(&my_addr, me->addr); len = append_address_to_payload(out, &my_addr); if (len < 0) return -1; + out += len; + + if (!tor_addr_is_null(&me->ipv6_addr)) { + len = append_address_to_payload(out, &me->ipv6_addr); + if (len < 0) + return -1; + } } else { *out = 0; } |