mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 23:53:32 +01:00
Merge remote-tracking branch 'public/bug10987_024'
This commit is contained in:
commit
6eba3584b1
7
changes/bug10987
Normal file
7
changes/bug10987
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
o Minor bugfixes
|
||||||
|
|
||||||
|
- Fix IPv6 support when using the SocksPort with SOCKS5. Using IPv6
|
||||||
|
through a SOCKS5 using the SocksPort option will now work with
|
||||||
|
this fix. This part of the code has never been updated to support
|
||||||
|
IPv6 thus this does not fix a previously introduced regression.
|
||||||
|
Fixes bug 10987; bugfix on 0.2.4.7-alpha.
|
@ -2273,13 +2273,24 @@ connection_ap_handshake_socks_reply(entry_connection_t *conn, char *reply,
|
|||||||
/* leave version, destport, destip zero */
|
/* leave version, destport, destip zero */
|
||||||
connection_write_to_buf(buf, SOCKS4_NETWORK_LEN, ENTRY_TO_CONN(conn));
|
connection_write_to_buf(buf, SOCKS4_NETWORK_LEN, ENTRY_TO_CONN(conn));
|
||||||
} else if (conn->socks_request->socks_version == 5) {
|
} else if (conn->socks_request->socks_version == 5) {
|
||||||
buf[0] = 5; /* version 5 */
|
size_t buf_len;
|
||||||
buf[1] = (char)status;
|
memset(buf,0,sizeof(buf));
|
||||||
buf[2] = 0;
|
if (tor_addr_family(&conn->edge_.base_.addr) == AF_INET) {
|
||||||
buf[3] = 1; /* ipv4 addr */
|
buf[0] = 5; /* version 5 */
|
||||||
memset(buf+4,0,6); /* Set external addr/port to 0.
|
buf[1] = (char)status;
|
||||||
The spec doesn't seem to say what to do here. -RD */
|
buf[2] = 0;
|
||||||
connection_write_to_buf(buf,10,ENTRY_TO_CONN(conn));
|
buf[3] = 1; /* ipv4 addr */
|
||||||
|
/* 4 bytes for the header, 2 bytes for the port, 4 for the address. */
|
||||||
|
buf_len = 10;
|
||||||
|
} else { /* AF_INET6. */
|
||||||
|
buf[0] = 5; /* version 5 */
|
||||||
|
buf[1] = (char)status;
|
||||||
|
buf[2] = 0;
|
||||||
|
buf[3] = 4; /* ipv6 addr */
|
||||||
|
/* 4 bytes for the header, 2 bytes for the port, 16 for the address. */
|
||||||
|
buf_len = 22;
|
||||||
|
}
|
||||||
|
connection_write_to_buf(buf,buf_len,ENTRY_TO_CONN(conn));
|
||||||
}
|
}
|
||||||
/* If socks_version isn't 4 or 5, don't send anything.
|
/* If socks_version isn't 4 or 5, don't send anything.
|
||||||
* This can happen in the case of AP bridges. */
|
* This can happen in the case of AP bridges. */
|
||||||
|
Loading…
Reference in New Issue
Block a user