diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-08-20 14:59:05 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-08-20 14:59:05 +0000 |
commit | 113367bc0174f6111acd2f002b8bacef736c0de4 (patch) | |
tree | 7c329a3eda9c0a004883f206a45fed06d8a0f291 | |
parent | ed801a8d3eacbfaaaae0ccab118a13ac3abc751b (diff) | |
download | tor-113367bc0174f6111acd2f002b8bacef736c0de4.tar.gz tor-113367bc0174f6111acd2f002b8bacef736c0de4.zip |
r14722@catbus: nickm | 2007-08-20 10:54:29 -0400
Add debugging warning to not abort in the case of bug 483. This is probably not an actual error case, so we should figure out what is really causing it and do something more sensible.
svn:r11215
-rw-r--r-- | src/or/connection.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index b67cd1e2cc..23a0be1fdd 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -931,7 +931,15 @@ connection_handle_listener_read(connection_t *conn, int new_type) if (options->ConstrainedSockets) set_constrained_socket_buffers(news, (int)options->ConstrainedSockSize); - tor_assert(((struct sockaddr*)addrbuf)->sa_family == conn->socket_family); + if (((struct sockaddr*)addrbuf)->sa_family != conn->socket_family) { + log_warn(LD_BUG, "A listener connection returned a socket with a " + "mismatched family. %s for addr_family %d gave us a socket " + "with address family %d.", conn_type_to_string(conn->type), + (int)conn->socket_family, + (int)((struct sockaddr*)addrbuf)->sa_family); + tor_close_socket(news); + return 0; + } if (conn->socket_family == AF_INET) { if (check_sockaddr_in((struct sockaddr*)addrbuf, remotelen, LOG_INFO)<0) { |