From 2b5a0356047e7622c66e434cd8ac4a7689d4cc28 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 2 Dec 2011 16:09:16 -0500 Subject: [PATCH] tor_accept_socket() should take tor_addr_t for listener arg Fixes bug 4535; bugfix on 0.2.2.28-beta; found by "troll_un" --- changes/bug4535 | 3 +++ src/common/compat.c | 2 +- src/common/compat.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changes/bug4535 diff --git a/changes/bug4535 b/changes/bug4535 new file mode 100644 index 0000000000..57ced29d0b --- /dev/null +++ b/changes/bug4535 @@ -0,0 +1,3 @@ + o Minor bugfixes: + - Use tor_socket_t type for listener argument to accept(). Fixes bug + 4535; bugfix on 0.2.2.28-beta. Found by "troll_un". diff --git a/src/common/compat.c b/src/common/compat.c index 266fc61c4c..a4e50747cd 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -934,7 +934,7 @@ tor_open_socket(int domain, int type, int protocol) /** As socket(), but counts the number of open sockets. */ tor_socket_t -tor_accept_socket(int sockfd, struct sockaddr *addr, socklen_t *len) +tor_accept_socket(tor_socket_t sockfd, struct sockaddr *addr, socklen_t *len) { tor_socket_t s = accept(sockfd, addr, len); if (SOCKET_OK(s)) { diff --git a/src/common/compat.h b/src/common/compat.h index 011b9c8674..3e1b5b8263 100644 --- a/src/common/compat.h +++ b/src/common/compat.h @@ -404,7 +404,7 @@ typedef int socklen_t; int tor_close_socket(tor_socket_t s); tor_socket_t tor_open_socket(int domain, int type, int protocol); -tor_socket_t tor_accept_socket(int sockfd, struct sockaddr *addr, +tor_socket_t tor_accept_socket(tor_socket_t sockfd, struct sockaddr *addr, socklen_t *len); int get_n_open_sockets(void);