]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: sock: fix sock_create_server_socket
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Wed, 22 May 2024 09:12:46 +0000 (11:12 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 May 2024 09:59:55 +0000 (11:59 +0200)
Set stream_err value as SF_ERR_NONE, if obtained socket fd has passed all
common runtime and configuration related checks.

'.connect()' method implementation in higher protocol layers requires Stream
Error Flag as the return value. So, at the socket layer, we need to pass to
sock_create_server_socket() a variable to set this flag, because syscalls and
some socket options checks are convenient to performe at the socket layer.

src/sock.c

index 6b23c9cebc33a4753b27820481b5caa88a2c7e6c..fba92bd7cf3ee2801ab44a48c41c782f2843422f 100644 (file)
@@ -326,7 +326,7 @@ int sock_create_server_socket(struct connection *conn, struct proxy *be, int *st
        if (conn->flags & CO_FL_OPT_TOS)
                sock_set_tos(sock_fd, conn->dst, conn->tos);
 
-       stream_err = SF_ERR_NONE;
+       *stream_err = SF_ERR_NONE;
        return sock_fd;
 }