[BB#81] allow listening on multiple families when no Listen is provided in config
This is achieved by not stopping at the first result of getaddrinfo
that we managed to listen on: Without "Listen" in the config, we
call getraddrinfo with NULL address. With AI_PASSIVE, this gives results
for both IPv4 and IPv6 wildcard addresses (if both are supported).
This lets tinyproxy listen on both IPv4 and IPv6 wildcard if the system
supports them.
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit d0732f9ade
)
This commit is contained in:
parent
fdfa365bae
commit
d11d23c14c
@ -281,10 +281,17 @@ int listen_sock (const char *addr, uint16_t port, vector_t listen_fds)
|
||||
|
||||
vector_append (listen_fds, &listenfd, sizeof(int));
|
||||
|
||||
/* success, don't continue */
|
||||
/* success */
|
||||
ret = 0;
|
||||
|
||||
if (addr != NULL) {
|
||||
/*
|
||||
* Unless wildcard is requested, only listen
|
||||
* on the first result that works.
|
||||
*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret != 0) {
|
||||
log_message (LOG_ERR, "Unable to listen on any address.");
|
||||
|
Loading…
Reference in New Issue
Block a user