diff options
author | Todd Short <todd.short@me.com> | 2022-03-08 09:36:43 -0500 |
---|---|---|
committer | Todd Short <todd.short@me.com> | 2022-03-10 09:26:45 -0500 |
commit | 005bb591a01a7434cbc05378c35ef3746ce0b82d (patch) | |
tree | aeac24b89ab378a939644c7a3aaf11c6612868ca /apps | |
parent | b1d856597804559ca77600f39f38185b841c2b0b (diff) |
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)
(cherry picked from commit 54b6755702309487ea860e1cc3e60ccef4cf7878)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/lib/s_socket.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/lib/s_socket.c b/apps/lib/s_socket.c index dbeebb54c5..b1f9c15d2d 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; |