From: Valentine Krasnobaeva Date: Wed, 22 May 2024 09:12:46 +0000 (+0200) Subject: BUG/MINOR: sock: fix sock_create_server_socket X-Git-Tag: v3.0-dev13~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83ab1479d0d30d50d55892d8733d1703a4ab22cc;p=thirdparty%2Fhaproxy.git BUG/MINOR: sock: fix sock_create_server_socket 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. --- diff --git a/src/sock.c b/src/sock.c index 6b23c9cebc..fba92bd7cf 100644 --- a/src/sock.c +++ b/src/sock.c @@ -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; }