openssl/util
Neil Horman fe26b6b496 Fix quicserver binding when duplicate entries exist
In testing the quic demos, I found that the quicserver refused to start for me,
indicating an inability to bind a socket to listen on

The problem turned out to be that getaddrinfo on my system was returning
multiple entries, due to the fact that /etc/host maps the localhost host name to
both ipv4 (127.0.0.1) and ipv6 (::1), but returns the latter as an ipv4 mapped
address (specifying family == AF_INET)

It seems like the proper fix would be to modify the /etc/hosts file to not make
that mapping, and indeed that works.  However, since several distribution ship
with this setup, it seems like it is worthwhile to manage it in the server code.

its also that some other application may be bound to a given address/port
leading to failure, which I think could be considered erroneous, as any failure
for the full addrinfo list in quicserver would lead to a complete failure

Fix this by modifying the create_dgram_bio function to count the number of
sockets is successfully binds/listens on, skipping any failures, and only exit
the application if the number of bound sockets is zero.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22559)
2023-11-02 11:26:21 +00:00
..
perl fips selftest: avoid relying on a real RNG for self tests 2023-09-27 17:22:54 +01:00
platform_symbols Create a rudimentary symbol scanning script 2023-11-01 16:32:26 +01:00
add-depends.pl
build.info quicserver.c: Use BIO_printf to stderr instead of plain printf 2023-08-14 15:53:44 +02:00
c-compress-test.pl
cavs-to-evptest.pl
check-format-test-negatives.c
check-format-test-positives.c
check-format.pl Copyright year updates 2023-09-07 09:59:15 +01:00
check-malloc-errs
checkplatformsyms.pl Create a rudimentary symbol scanning script 2023-11-01 16:32:26 +01:00
ck_errf.pl
copy.pl
ctags.sh Fix new typos found by codespell 2023-06-18 16:53:09 +10:00
dofile.pl
echo.pl
engines.num
err-to-raise
find-doc-nits Copyright year updates 2023-09-07 09:59:15 +01:00
find-unused-errs
fips-checksums.sh
fix-deprecation
fix-includes
fix-includes.sed
help.pl
indent.pro Removed unused struct ssl3_comp_st 2023-08-29 16:59:54 +02:00
lang-compress.pl
libcrypto.num All lh_stats functions were deprecated in 3.1 2023-10-04 07:52:41 +11:00
libssl.num QUIC APL: Allow stream origin to be queried 2023-09-01 14:02:50 +01:00
markdownlint.rb Adjust mdl configuration 2023-10-24 17:34:07 +01:00
merge-err-lines
missingcrypto111.txt
missingcrypto-internal.txt
missingcrypto.txt man: update missingcrypto.txt file 2023-08-30 15:51:47 +01:00
missingmacro111.txt
missingmacro.txt
missingssl111.txt
missingssl-internal.txt
missingssl.txt Add documentation for the function SSL_CONF_CTX_finish. 2023-09-20 10:25:51 +10:00
mk-fipsmodule-cnf.pl Copyright year updates 2023-09-07 09:59:15 +01:00
mkbuildinf.pl
mkdef.pl
mkdir-p.pl
mkerr.pl Copyright year updates 2023-09-07 09:59:15 +01:00
mknum.pl
mkpod2html.pl
mkrc.pl
mktar.sh
opensslwrap.sh
other-internal.syms
other.syms QUIC API: Revise SSL_get_conn_close_info to use a flags field 2023-09-01 14:02:50 +01:00
providers.num
quicserver.c Fix quicserver binding when duplicate entries exist 2023-11-02 11:26:21 +00:00
shlib_wrap.sh.in
su-filter.pl
withlibctx.pl
wrap.pl.in
write-man-symlinks