summaryrefslogtreecommitdiffstats
path: root/apps/s_socket.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-02-10 20:54:48 +0100
committerRichard Levitte <levitte@openssl.org>2016-02-10 20:58:18 +0100
commit968d1a23726dbca82ac694a508efe8ea37d0a95e (patch)
tree2058965bdce5fc2bf1210c133ff246bcbda872ba /apps/s_socket.c
parent07aa1e0459da67de3f0a866f2c7bc48193698597 (diff)
Use the protocol we know rather than BIO_ADDRINFO_protocol(res)
Because some platforms won't will in any value in ai_protocol, there's no point using it if we already know what it should be. Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'apps/s_socket.c')
-rw-r--r--apps/s_socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/s_socket.c b/apps/s_socket.c
index e345913b0d..20c662664d 100644
--- a/apps/s_socket.c
+++ b/apps/s_socket.c
@@ -179,7 +179,7 @@ int init_client(int *sock, const char *host, const char *port,
&& (type == 0 || type == BIO_ADDRINFO_socktype(res)));
*sock = BIO_socket(BIO_ADDRINFO_family(ai), BIO_ADDRINFO_socktype(ai),
- BIO_ADDRINFO_protocol(ai), 0);
+ protocol, 0);
if (*sock == INVALID_SOCKET) {
/* Maybe the kernel doesn't support the socket family, even if
* BIO_lookup() added it in the returned result...
@@ -257,7 +257,7 @@ int do_server(int *accept_sock, const char *host, const char *port,
&& (type == 0 || type == BIO_ADDRINFO_socktype(res)));
asock = BIO_socket(BIO_ADDRINFO_family(res), BIO_ADDRINFO_socktype(res),
- BIO_ADDRINFO_protocol(res), 0);
+ protocol, 0);
if (asock == INVALID_SOCKET
|| !BIO_listen(asock, BIO_ADDRINFO_address(res), BIO_SOCK_REUSEADDR)) {
BIO_ADDRINFO_free(res);