summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-06-22 15:38:28 +0000
committerjsing <jsing@openbsd.org>2014-06-22 15:38:28 +0000
commitb80545118f90e72e265636fae11c6cef48d78f7b (patch)
tree363e1c8f569a07c4ae90c2c0772acd58c534998e /lib/libssl/src
parentmissing .Pa macro below FILES; (diff)
downloadwireguard-openbsd-b80545118f90e72e265636fae11c6cef48d78f7b.tar.xz
wireguard-openbsd-b80545118f90e72e265636fae11c6cef48d78f7b.zip
Just use SOMAXCONN and IPPROTO_TCP, since we know we have them.
Diffstat (limited to 'lib/libssl/src')
-rw-r--r--lib/libssl/src/crypto/bio/b_sock.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/lib/libssl/src/crypto/bio/b_sock.c b/lib/libssl/src/crypto/bio/b_sock.c
index ddd2abb625c..58d57db2817 100644
--- a/lib/libssl/src/crypto/bio/b_sock.c
+++ b/lib/libssl/src/crypto/bio/b_sock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: b_sock.c,v 1.39 2014/06/22 14:41:10 jsing Exp $ */
+/* $OpenBSD: b_sock.c,v 1.40 2014/06/22 15:38:28 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -71,16 +71,6 @@
#include "cryptlib.h"
-#define SOCKET_PROTOCOL IPPROTO_TCP
-
-#ifdef SO_MAXCONN
-#define MAX_LISTEN SO_MAXCONN
-#elif defined(SOMAXCONN)
-#define MAX_LISTEN SOMAXCONN
-#else
-#define MAX_LISTEN 32
-#endif
-
static int get_ip(const char *str, unsigned char *ip);
int
@@ -371,7 +361,7 @@ BIO_get_accept_socket(char *host, int bind_mode)
}
again:
- s = socket(server.sa.sa_family, SOCK_STREAM, SOCKET_PROTOCOL);
+ s = socket(server.sa.sa_family, SOCK_STREAM, IPPROTO_TCP);
if (s == -1) {
SYSerr(SYS_F_SOCKET, errno);
ERR_asprintf_error_data("port='%s'", host);
@@ -402,7 +392,7 @@ again:
} else
goto err;
}
- cs = socket(client.sa.sa_family, SOCK_STREAM, SOCKET_PROTOCOL);
+ cs = socket(client.sa.sa_family, SOCK_STREAM, IPPROTO_TCP);
if (cs != -1) {
int ii;
ii = connect(cs, &client.sa, addrlen);
@@ -422,7 +412,7 @@ again:
BIOerr(BIO_F_BIO_GET_ACCEPT_SOCKET, BIO_R_UNABLE_TO_BIND_SOCKET);
goto err;
}
- if (listen(s, MAX_LISTEN) == -1) {
+ if (listen(s, SOMAXCONN) == -1) {
SYSerr(SYS_F_BIND, errno);
ERR_asprintf_error_data("port='%s'", host);
BIOerr(BIO_F_BIO_GET_ACCEPT_SOCKET, BIO_R_UNABLE_TO_LISTEN_SOCKET);