[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #15215 [Tor]: Use destination address type in SOCKS5 reply rather than AP address
#15215: Use destination address type in SOCKS5 reply rather than AP address
------------------------+--------------------------------
Reporter: sysrqb | Owner:
Type: defect | Status: needs_review
Priority: normal | Milestone: Tor: 0.2.7.x-final
Component: Tor | Version:
Resolution: | Keywords:
Actual Points: | Parent ID:
Points: |
------------------------+--------------------------------
Changes (by sysrqb):
* status: new => needs_review
Comment:
This seems to work for me, is there a better way?
{{{
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 2a1a2f0..f18474f 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -2568,9 +2568,10 @@
connection_ap_handshake_socks_reply(entry_connection_t *conn, char *reply,
/* leave version, destport, destip zero */
connection_write_to_buf(buf, SOCKS4_NETWORK_LEN,
ENTRY_TO_CONN(conn));
} else if (conn->socks_request->socks_version == 5) {
+ tor_addr_t addr;
size_t buf_len;
memset(buf,0,sizeof(buf));
- if (tor_addr_family(&conn->edge_.base_.addr) == AF_INET) {
+ if (tor_addr_parse(&addr, conn->socks_request->address) == AF_INET) {
buf[0] = 5; /* version 5 */
buf[1] = (char)status;
buf[2] = 0;
}}}
Also in my pub repo on branch bug15215.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/15215#comment:1>
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