summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2014-06-22 15:38:29 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2014-06-22 15:38:29 +0000
commit9ef28fc1477d02a6405221e214e5c6226cadfdfd (patch)
treeb4c0861aa3a7a32d70984a926fa7660617e66e74
parentdbc7cf1becfdcb28934e6b4bac8d643be688149e (diff)
Just use SOMAXCONN and IPPROTO_TCP, since we know we have them.
-rw-r--r--lib/libcrypto/bio/b_sock.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/lib/libcrypto/bio/b_sock.c b/lib/libcrypto/bio/b_sock.c
index ddd2abb625c..58d57db2817 100644
--- a/lib/libcrypto/bio/b_sock.c
+++ b/lib/libcrypto/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);