]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: listener: make sock_find_compatible_fd() check the socket type
authorWilly Tarreau <w@1wt.eu>
Wed, 16 Sep 2020 19:44:42 +0000 (21:44 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Sep 2020 20:08:07 +0000 (22:08 +0200)
sock_find_compatible_fd() can now access the protocol via the receiver
hence it can access its socket type and know whether the receiver has
dgram or stream sockets, so we don't need to hack around AF_CUST_UDP*
anymore there.

src/sock.c

index 8bdc3eaffa9969e246397cdca10b0a08ffe09920..3e7ba708a6470ed89eb8f050eb7485db5a199ae0 100644 (file)
@@ -366,10 +366,7 @@ int sock_find_compatible_fd(const struct listener *l)
        if (!l->rx.proto->addrcmp)
                return -1;
 
-       /* WT: this is not the right way to do it, it is temporary for the
-        *     transition to receivers.
-        */
-       if (l->rx.addr.ss_family == AF_CUST_UDP4 || l->rx.addr.ss_family == AF_CUST_UDP6)
+       if (l->rx.proto->sock_type == SOCK_DGRAM)
                options |= SOCK_XFER_OPT_DGRAM;
 
        if (l->options & LI_O_FOREIGN)