mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 20:46:11 +02:00
MINOR: tools: drop listener detection hack from str2sa_range()
We used to resort to a trick to detect whether the caller was a listener or an outgoing socket in order never to present an AF_CUST_UDP* socket to a log server nor a nameserver. This is no longer necessary, the socket type alone will be enough.
This commit is contained in:
parent
2b5e0d8b6a
commit
af9609b4d1
11
src/tools.c
11
src/tools.c
@ -1170,16 +1170,9 @@ struct sockaddr_storage *str2sa_range(const char *str, int *port, int *low, int
|
||||
* in which case the address is not known yet (this is only
|
||||
* for servers actually).
|
||||
*/
|
||||
|
||||
/* FIXME: for now UDP is still its own family. However some UDP clients
|
||||
* (logs, dns) use AF_INET and are not aware of AF_CUST_UDP*. Since we
|
||||
* only want this mapping for listeners and they are the only ones
|
||||
* setting PA_O_SOCKET_FD, for now we condition this mapping to this.
|
||||
* This effectively means that for now we return TCPv4/v6 for UDP senders.
|
||||
*/
|
||||
new_proto = protocol_lookup(ss.ss_family,
|
||||
(opts & PA_O_SOCKET_FD) && sock_type == SOCK_DGRAM,
|
||||
(opts & PA_O_SOCKET_FD) && ctrl_type == SOCK_DGRAM);
|
||||
sock_type == SOCK_DGRAM,
|
||||
ctrl_type == SOCK_DGRAM);
|
||||
|
||||
if (!new_proto && (!fqdn || !*fqdn)) {
|
||||
memprintf(err, "unsupported protocol family %d for address '%s'", ss.ss_family, str);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user