[tor-bugs] #27920 [Core Tor/Torsocks]: "Resolve destination buffer too small" is unclear (was: torsocks fails to open socks 4 connection: [socks5] Resolve destination buffer too small (in socks5_recv_resolve_reply() at socks5.c:707))

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Jan 17 18:47:10 UTC 2019


#27920: "Resolve destination buffer too small" is unclear
-------------------------------+-------------------------
 Reporter:  traumschule        |          Owner:  dgoulet
     Type:  defect             |         Status:  new
 Priority:  Medium             |      Milestone:
Component:  Core Tor/Torsocks  |        Version:
 Severity:  Normal             |     Resolution:
 Keywords:                     |  Actual Points:
Parent ID:                     |         Points:
 Reviewer:                     |        Sponsor:
-------------------------------+-------------------------

Comment (by traumschule):

 Sometimes {{{Resolve destination buffer too small}}} means tor-resolve
 failed because of a (temporary) connection issue. The message is not clear
 and the user wants to know if the connection failed or if  there's indeed
 no record for that address to assess if retrying is worthwhile. Could
 torsocks try harder?

 {{{
 $ torsocks -d curl torproject.org
 ...
 1547745542 DEBUG torsocks[26790]: Resolving torproject.org on the Tor
 network (in tsocks_tor_resolve() at torsocks.c:545)
 1547745542 DEBUG torsocks[26790]: Setting up a connection to the Tor
 network on fd 3 (in setup_tor_connection() at torsocks.c:368)
 1547745542 DEBUG torsocks[26790]: Socks5 sending method ver: 5, nmethods
 0x01, methods 0x00 (in socks5_send_method() at socks5.c:229)
 1547745542 DEBUG torsocks[26790]: Socks5 received method ver: 5, method
 0x00 (in socks5_recv_method() at socks5.c:262)
 1547745542 DEBUG torsocks[26790]: [socks5] Resolve for torproject.org sent
 successfully (in socks5_send_resolve_request() at socks5.c:633)
 1547745542 ERROR torsocks[26790]: [socks5] Resolve destination buffer too
 small (in socks5_recv_resolve_reply() at socks5.c:701)
 curl: (6) Could not resolve host: torproject.org
 1547745542 DEBUG torsocks[26790]: [onion] Destroying onion pool containing
 0 entry (in onion_pool_destroy() at onion.c:148)

 $ torsocks --version
 Torsocks 2.3.0
 }}}

 https://gitweb.torproject.org/torsocks.git/tree/src/common/socks5.c#n637
 {{{
 /*
  * Receive a Tor resolve reply on the given connection. The ip address
 pointer
  * is populated with the replied value or else untouched on error.
  *
  * Return 0 on success else a negative value.
  */
 ATTR_HIDDEN
 int socks5_recv_resolve_reply(struct connection *conn, void *addr,
                 size_t addrlen)
 {

 ...

         if (addrlen < recv_len) {
                 ERR("[socks5] Resolve destination buffer too small");
                 ret = -EINVAL;
                 goto error;
         }
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/27920#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list