From: Willy Tarreau Date: Wed, 16 Sep 2020 19:44:42 +0000 (+0200) Subject: MINOR: listener: make sock_find_compatible_fd() check the socket type X-Git-Tag: v2.3-dev5~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dfabfed134a79d67c9810387c0bd1a6ea04d344;p=thirdparty%2Fhaproxy.git MINOR: listener: make sock_find_compatible_fd() check the socket type 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. --- diff --git a/src/sock.c b/src/sock.c index 8bdc3eaffa..3e7ba708a6 100644 --- a/src/sock.c +++ b/src/sock.c @@ -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)