aboutsummaryrefslogtreecommitdiffstats
path: root/apps/lib
diff options
context:
space:
mode:
authorTodd Short <todd.short@me.com>2022-03-08 09:36:43 -0500
committerTodd Short <todd.short@me.com>2022-03-10 09:24:48 -0500
commit54b6755702309487ea860e1cc3e60ccef4cf7878 (patch)
tree6e479d5557091d2e709ba3afc1d503b82d2cc025 /apps/lib
parent175355923046921a689b500f7a72455f7095708f (diff)
downloadopenssl-54b6755702309487ea860e1cc3e60ccef4cf7878.tar.gz
Set protocol in init_client()
If TCP is being used, protocol = 0 is passed to init_client(), then protocol == IPPROTO_TCP fails when attempting to set BIO_SOCK_NODELAY. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17838)
Diffstat (limited to 'apps/lib')
-rw-r--r--apps/lib/s_socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/lib/s_socket.c b/apps/lib/s_socket.c
index 0751d460e8..e5802d5054 100644
--- a/apps/lib/s_socket.c
+++ b/apps/lib/s_socket.c
@@ -162,7 +162,7 @@ int init_client(int *sock, const char *host, const char *port,
#endif
if (!BIO_connect(*sock, BIO_ADDRINFO_address(ai),
- protocol == IPPROTO_TCP ? BIO_SOCK_NODELAY : 0)) {
+ BIO_ADDRINFO_protocol(ai) == IPPROTO_TCP ? BIO_SOCK_NODELAY : 0)) {
BIO_closesocket(*sock);
*sock = INVALID_SOCKET;
continue;