]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: tools: drop listener detection hack from str2sa_range()
authorWilly Tarreau <w@1wt.eu>
Wed, 16 Sep 2020 20:04:46 +0000 (22:04 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Sep 2020 20:08:08 +0000 (22:08 +0200)
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.

src/tools.c

index 54cf2d644b64a3afff8451cace3a62c03790d0be..53d2486f46ebe8b639c95feae6b5ad214704dfac 100644 (file)
@@ -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);