Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Matt Caswell <[email protected]> (Merged from openssl#22559)
- Loading branch information