[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #7011 [Tor]: Stored IPv6 TransportProxy bindaddr lacks brackets
#7011: Stored IPv6 TransportProxy bindaddr lacks brackets
------------------------+---------------------------------------------------
Reporter: dcf | Owner: asn
Type: defect | Status: needs_review
Priority: normal | Milestone: Tor: 0.2.4.x-final
Component: Tor | Version:
Keywords: tor-bridge | Parent:
Points: | Actualpoints:
------------------------+---------------------------------------------------
Comment(by asn):
`pt_get_extra_info_descriptor_string` needs some attention indeed. Mainly
because of the `fmt_addr32()` that is called.
How about changing:
{{{
/* If the transport proxy returned "0.0.0.0" as its address, and
* we know our external IP address, use it. Otherwise, use the
* returned address. */
const char *addr_str = fmt_addr(&t->addr);
uint32_t external_ip_address = 0;
if (tor_addr_is_null(&t->addr) &&
router_pick_published_address(get_options(),
&external_ip_address) >= 0) {
/* returned addr was 0.0.0.0 and we found our external IP
address: use it. */
addr_str = fmt_addr32(external_ip_address);
}
smartlist_add_asprintf(string_chunks,
"transport %s %s:%u",
t->name, addr_str, t->port);
}}}
to
{{{
/* If the transport proxy returned "0.0.0.0" as its address, and
* we know our external IP address, use it. Otherwise, use the
* returned address. */
const char *addrport = NULL;
uint32_t external_ip_address = 0;
if (tor_addr_is_null(&t->addr) &&
router_pick_published_address(get_options(),
&external_ip_address) >= 0) {
tor_addr_t addr;
tor_addr_from_ipv4h(&addr, external_ip_address);
addrport = fmt_addrport(&addr, t->port);
} else {
addrport = fmt_addrport(&t->addr, t->port);
}
smartlist_add_asprintf(string_chunks,
"transport %s %s",
t->name, addrport);
}}}
BTW, `router_pick_published_address()` seems to only set 32-bit IP
addresses, so using `tor_addr_from_ipv4h()` should be OK. Why does
`router_pick_published_address()` only work for 32-bit IP addresses?
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/7011#comment:11>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs