]> git.kaiwu.me - nginx.git/commit
Filtering duplicate addresses in listen (ticket #2400).
authorMaxim Dounin <mdounin@mdounin.ru>
Wed, 23 Nov 2022 14:30:08 +0000 (17:30 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Wed, 23 Nov 2022 14:30:08 +0000 (17:30 +0300)
commit22223c75c9715e568f5710a8eed1fee9e7c2983f
tree09d21b13a921c385119565c107b15f0ae66a4578
parent17066ac8600412eabb1fdf8360cf6ada13f02391
Filtering duplicate addresses in listen (ticket #2400).

Due to the glibc bug[1], getaddrinfo("localhost") with AI_ADDRCONFIG
on a typical host with glibc and without IPv6 returns two 127.0.0.1
addresses, and therefore "listen localhost:80;" used to result in
"duplicate ... address and port pair" after 4f9b72a229c1.

Fix is to explicitly filter out duplicate addresses returned during
resolution of a name.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=14969
src/http/ngx_http_core_module.c
src/mail/ngx_mail_core_module.c
src/stream/ngx_stream_core_module.c