Skip to content

Commit

Permalink
connect: Always pass .onion IP cookie to connection object
Browse files Browse the repository at this point in the history
Fixes #23876

Signed-off-by: David Goulet <[email protected]>
  • Loading branch information
dgoulet-tor committed Apr 20, 2018
1 parent 8258eac commit 2fa5591
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,11 @@ LIBC_CONNECT_RET_TYPE tsocks_connect(LIBC_CONNECT_SIG)
onion_pool_unlock(&tsocks_onion_pool);
if (on_entry) {
/*
* Create a connection without a destination address since we will set
* Create a connection with the onion IP cookie since getpeername()
* might need it, and set connection domain and hostname to use
* the onion address name found before.
*/
new_conn = connection_create(sockfd, NULL);
new_conn = connection_create(sockfd, addr);
if (!new_conn) {
errno = ENOMEM;
goto error;
Expand Down

0 comments on commit 2fa5591

Please sign in to comment.