/* Bind to local addresses */
for (i = 0; i < local_ip_count; i++) {
- SILC_LOG_DEBUG(("Binding to local address %s",
- local_ip_addr ? local_ip_addr[i] : ipany));
+ SILC_LOG_DEBUG(("Binding to local address %s:%d",
+ local_ip_addr ? local_ip_addr[i] : ipany, port));
/* Set sockaddr for server */
if (!silc_net_set_sockaddr(&server,
}
#if defined(ECONNREFUSED)
- if (errno == ECONNREFUSED)
+ if (opt == ECONNREFUSED)
conn->status = SILC_NET_CONNECTION_REFUSED;
#endif /* ECONNREFUSED */
#if defined(ETIMEDOUT)
- if (errno == ETIMEDOUT)
+ if (opt == ETIMEDOUT)
conn->status = SILC_NET_CONNECTION_TIMEOUT;
#endif /* ETIMEDOUT */
#if defined(ENETUNREACH)
- if (errno == ENETUNREACH)
+ if (opt == ENETUNREACH)
conn->status = SILC_NET_HOST_UNREACHABLE;
#endif /* ENETUNREACH */
/** Connecting failed */
- SILC_LOG_DEBUG(("Connecting failed"));
+ SILC_LOG_DEBUG(("Connecting failed, error %s", strerror(opt)));
silc_fsm_next(fsm, silc_net_connect_st_finish);
return SILC_FSM_CONTINUE;
}