r9319@totoro: nickm | 2006-11-14 13:04:50 -0500

Patch from Zajcev Evgeny to make natd work properly (we needed to allow extra characters after the port number).


svn:r8952
This commit is contained in:
Nick Mathewson 2006-11-14 18:05:01 +00:00
parent ad1f019110
commit b052b810e2

View File

@ -1550,7 +1550,8 @@ connection_ap_process_natd(edge_connection_t *conn)
/* pretend that a socks handshake completed so we don't try to /* pretend that a socks handshake completed so we don't try to
* send a socks reply down a natd conn */ * send a socks reply down a natd conn */
strlcpy(socks->address, daddr, sizeof(socks->address)); strlcpy(socks->address, daddr, sizeof(socks->address));
socks->port = (uint16_t) tor_parse_long(tbuf, 10, 1, 65535, &port_ok, NULL); socks->port = (uint16_t)
tor_parse_long(tbuf, 10, 1, 65535, &port_ok, &daddr);
if (!port_ok) { if (!port_ok) {
log_warn(LD_APP,"Natd handshake failed; port '%s' is ill-formed or out " log_warn(LD_APP,"Natd handshake failed; port '%s' is ill-formed or out "
"of range.", escaped(tbuf)); "of range.", escaped(tbuf));