No IPv6 support when suggesting a bindaddr to a PT
This recent post in tor-talk: http://www.marshut.com/iwuqqh/setting-up-an-ipv6-%20supporting-obfs3-bridge.html revealed that Tor does not support IPv6 when supporting a bind address to a pluggable transport. It seems that we missed that during #7011 (moved).
The problem is that the first time someone fires up a
ServerTransportPlugin, Tor will suggest to it to bind in
0.0.0.0:0. This can be seen in
no_bindaddr_found: /** If we didn't find references for this pluggable transport in the state file, we should instruct the pluggable transport proxy to listen on INADDR_ANY on a random ephemeral port. */ tor_asprintf(&default_addrport, "%s:%s", fmt_addr32(INADDR_ANY), "0"); return default_addrport;
Instead of using
fmt_addr32(INADDR_ANY), we should use
fmt_addrport and suggest
[::] if we need to use IPv6. We should probably suggest an IPv6 address, if our ORPort is IPv6 (what if we have both kinds of ORPorts?).
Implementation of this should not be hard. I can do it one of these days.