]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: test IP_PKTINFO support for quic-conn owned socket
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 1 Dec 2022 13:51:16 +0000 (14:51 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 2 Dec 2022 13:45:43 +0000 (14:45 +0100)
Extend the startup platform detection support test for quic-conn owned
socket. It is required to be able to retrieve destination address on a
recvfrom() system call so check if IP_PKTINFO or IP_RECVDSTADDR flags
are supported.

This change is part of quic-conn owned socket implementation.
It may be backported to 2.7 after a period of observation.

src/proto_quic.c

index 003e510b64ac44cfba18686fa7b7feff49c2055c..9dd96337fe7b446830996f805e705c4df83dc5a3 100644 (file)
@@ -581,6 +581,15 @@ static int quic_test_sock_per_conn_support(struct listener *l)
        const struct receiver *rx = &l->rx;
        int ret = 1, fdtest;
 
+       /* Check if IP destination address can be retrieved on recvfrom()
+        * operation.
+        */
+#if !defined(IP_PKTINFO) && !defined(IP_RECVDSTADDR)
+       ha_alert("Your platform does not seem to support UDP source address retrieval through IP_PKTINFO or an alternative flag. "
+                "QUIC connections will use listener socket.\n");
+       ret = 0;
+#endif
+
        /* Check if platform support multiple UDP sockets bind on the same
         * local address. Create a dummy socket and bind it on the same address
         * as <l> listener. If bind system call fails, deactivate socket per