mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Use IP_BIND_ADDRESS_NO_PORT when dialing the ORPort on Linux.
When the orport-srcaddr option is set, we bind to a source IP address before dialing the ORPort/ExtORPort. tor similarly binds to a source IP address when OutboundBindAddress is set in torrc. Since tor 0.4.7.13, tor sets IP_BIND_ADDRESS_NO_PORT, and because problems arise when some programs use IP_BIND_ADDRESS_NO_PORT and some do not, we also have to start using IP_BIND_ADDRESS_NO_PORT when we upgrade tor (tpo/anti-censorship/pluggable-transports/snowflake#40270). Related: tpo/anti-censorship/pluggable-transports/snowflake#40198
This commit is contained in:
parent
130b63ccdd
commit
9edaee6547
4 changed files with 63 additions and 1 deletions
|
@ -76,7 +76,9 @@ func handleConn(conn net.Conn, orPortSrcAddr *net.IPNet) error {
|
|||
addr := conn.RemoteAddr().String()
|
||||
statsChannel <- addr != ""
|
||||
|
||||
dialer := net.Dialer{}
|
||||
dialer := net.Dialer{
|
||||
Control: dialerControl,
|
||||
}
|
||||
if orPortSrcAddr != nil {
|
||||
// Use a random source IP address in the given range.
|
||||
ip, err := randIPAddr(orPortSrcAddr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue