openssl/apps/lib
Daiki Ueno 09c1db3399 apps: Use the first detected address family if IPv6 is not available
This is a follow up of 15729bef38.  Even
when the host does not support IPv6 at all, BIO_lookup_ex may now
return IN6ADDR_ANY in addition to INADDR_ANY, as the second element of
the ai_next field.

After eee8a40aa5, the do_server function
prefers the IPv6 address and fails on the BIO_socket call.  This adds
a fallback code to retry with the IPv4 address returned as the first
element to avoid the error.

The failure had been partially avoided in the previous code with
AI_ADDRCONFIG, because getaddrinfo returns only IPv4 address if no
IPv6 address is associated with external interface.  However, it would
be still a problem if the external interface has an IPv6 address
assigned, while the loopback interface doesn't.

Signed-off-by: Daiki Ueno <dueno@redhat.com>

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16074)
2021-07-16 08:58:06 +02:00
..
app_libctx.c apps: move global libctx and property query into their own file 2021-06-15 18:26:47 +10:00
app_params.c
app_provider.c apps: add query to allow a command to know of a provider command line option was processed 2021-07-12 09:13:41 +10:00
app_rand.c
app_x509.c
apps_ui.c
apps.c apps: avoid using POSIX IO macros and functions when built without them. 2021-07-14 09:17:45 +02:00
build.info apps: move global libctx and property query into their own file 2021-06-15 18:26:47 +10:00
cmp_mock_srv.c cmp_mock_srv.c: Add missing OldCertID check for 'kur' cert update requests 2021-06-30 10:38:23 +02:00
columns.c
engine_loader.c
engine.c
fmt.c
http_server.c 80-test_cmp_http.t: Improve the way the test server is launched and killed 2021-06-09 14:03:16 +02:00
names.c
opt.c app: add library context and propq arguments to opt_md() and opt_cipher() 2021-07-12 09:13:41 +10:00
s_cb.c Adapt other parts of the source to the changed EVP_Q_digest() and EVP_Q_mac() 2021-06-23 23:00:36 +02:00
s_socket.c apps: Use the first detected address family if IPv6 is not available 2021-07-16 08:58:06 +02:00
tlssrp_depr.c
vms_decc_argv.c Update copyright year 2021-06-17 13:24:59 +01:00
vms_term_sock.c
win32_init.c