Commit 4a705a46 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Log local address in passthru connection failure

Altere reported via IRC:
!ERROR -1 (113) connecting to passthru socket

It might be helpful to know the address the passthru socket is bound to and the connection is being attempted on, so log that with the error.
parent be0c953e
Pipeline #2213 passed with stage
in 9 minutes and 4 seconds
......@@ -5641,6 +5641,7 @@ NO_SSH:
SOCKET tmp_sock;
SOCKADDR_IN tmp_addr={0};
socklen_t tmp_addr_len;
char addr_str[INET6_ADDRSTRLEN] = "";
/* open a socket and connect to yourself */
......@@ -5705,8 +5706,9 @@ NO_SSH:
result = connect(new_node->passthru_socket, (struct sockaddr *)&tmp_addr, tmp_addr_len);
if(result != 0) {
lprintf(LOG_ERR,"Node %d !ERROR %d (%d) connecting to passthru socket"
,new_node->cfg.node_num, result, ERROR_VALUE);
inet_ntop(tmp_addr.sin_family, &tmp_addr.sin_addr, addr_str, sizeof(addr_str));
lprintf(LOG_ERR,"Node %d !ERROR %d (%d) connecting to passthru socket: %s port %u"
,new_node->cfg.node_num, result, ERROR_VALUE, addr_str, addr_str, htons(tmp_addr.sin_port));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment