openssl/util
Neil Horman 28932ab1ac 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)

(cherry picked from commit fe26b6b496)
2023-11-02 11:28:24 +00:00
..
perl fips selftest: avoid relying on a real RNG for self tests 2023-09-27 17:22:54 +01:00
add-depends.pl Update copyright year 2022-05-03 13:34:51 +01:00
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 FIPS module checksums: add scripts and Makefile rule 2021-05-04 11:32:16 +02:00
cavs-to-evptest.pl
check-format-test-negatives.c check-format.pl: improve whitespace reporting on <op>= 2022-09-02 21:32:46 +02:00
check-format-test-positives.c check-format.pl: improve whitespace reporting on <op>= 2022-09-02 21:32:46 +02:00
check-format.pl Copyright year updates 2023-09-07 09:59:15 +01:00
check-malloc-errs
ck_errf.pl
copy.pl
ctags.sh Fix new typos found by codespell 2023-06-18 16:53:09 +10:00
dofile.pl configdata.pm.in, util/dofile.pl: Make a HERE document stricter. 2020-10-27 10:17:19 +01:00
echo.pl always use the same perl in $PATH 2021-09-02 12:55:39 +10:00
engines.num
err-to-raise Simplify util/err-to-raise 2020-11-18 11:40:52 +01:00
find-doc-nits Copyright year updates 2023-09-07 09:59:15 +01:00
find-unused-errs
fips-checksums.sh always use the same perl in $PATH 2021-09-02 12:55:39 +10:00
fix-deprecation always use the same perl in $PATH 2021-09-02 12:55:39 +10:00
fix-includes
fix-includes.sed
help.pl Add "make help" option 2023-03-06 08:00:58 +11:00
indent.pro Removed unused struct ssl3_comp_st 2023-08-29 16:59:54 +02:00
lang-compress.pl util: update FIPS checksumming script to be more aggressive with whitespace 2021-06-03 11:56:21 +10:00
libcrypto.num make update 2023-10-26 14:22:51 +01:00
libssl.num make update 2023-10-26 14:22:51 +01:00
markdownlint.rb Adjust mdl configuration 2023-10-24 17:34:07 +01:00
merge-err-lines
missingcrypto-internal.txt STORE: Move the built-in 'file:' loader to become an engine module 2020-09-03 17:48:32 +02:00
missingcrypto.txt man: update missingcrypto.txt file 2023-08-30 15:51:47 +01:00
missingcrypto111.txt DOC: Add a few previously documented functions 2021-11-23 19:34:19 +01:00
missingmacro.txt BIO_s_dgram: add documentation and hazard warnings 2022-12-15 06:32:45 +00:00
missingmacro111.txt Document some SSL DH related functions/macros 2020-11-18 14:14:53 +00:00
missingssl-internal.txt
missingssl.txt Add documentation for the function SSL_CONF_CTX_finish. 2023-09-20 10:25:51 +10:00
missingssl111.txt
mk-fipsmodule-cnf.pl Copyright year updates 2023-09-07 09:59:15 +01:00
mkbuildinf.pl
mkdef.pl Fix various typos, repeated words, align some spelling to LDP. 2022-10-12 16:55:28 +11:00
mkdir-p.pl Update copyright year 2021-04-08 13:04:41 +01:00
mkerr.pl Copyright year updates 2023-09-07 09:59:15 +01:00
mknum.pl Ensure ordinals are created during release process 2021-06-29 09:51:30 +10:00
mkpod2html.pl Fix util/mkpod2html.pl to call pod2html with absolute paths 2021-09-21 11:05:53 +02:00
mkrc.pl util/mkrc.pl: Make sure FILEVERSION and PRODUCTVERSION have four numbers 2020-11-17 13:18:16 +01:00
mktar.sh Fix treatment of BUILD_METADATA 2022-12-08 07:01:33 +01:00
opensslwrap.sh
other-internal.syms Suppress errors about undocumented asn1_d2i_read_bio 2021-02-22 12:11:38 +00:00
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:28:24 +00:00
shlib_wrap.sh.in Add explicit support in util/shlib_wrap.sh.in for NonStop DLL loading. 2021-03-30 19:08:32 +02:00
su-filter.pl
withlibctx.pl Perl util to do with_libctx renaming 2020-10-01 09:23:05 +01:00
wrap.pl.in Fix util/wrap.pl.in for VMS usage 2023-03-08 12:29:22 +01:00
write-man-symlinks write-man-symlinks: Write relative symlinks not absolute 2021-05-25 17:14:09 +02:00