From: Aperence Date: Mon, 26 Aug 2024 09:50:26 +0000 (+0200) Subject: MEDIUM: sock: use protocol when creating socket X-Git-Tag: v3.1-dev7~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2f171fe36a819bc9a1042291bca15bda650c23ff;p=thirdparty%2Fhaproxy.git MEDIUM: sock: use protocol when creating socket Use the protocol configured for a connection when creating the socket, instead of always using 0. This change is needed to allow new protocol to be used when creating the sockets, such as MPTCP. Note however that this patch won't change anything for now, as the only other value that proto->sock_prot could hold is IPPROTO_TCP, which has the same behavior as 0 when passed to socket. --- diff --git a/src/sock.c b/src/sock.c index c857820df3..aa524d886d 100644 --- a/src/sock.c +++ b/src/sock.c @@ -281,7 +281,7 @@ int sock_create_server_socket(struct connection *conn, struct proxy *be, int *st #endif proto = protocol_lookup(conn->dst->ss_family, PROTO_TYPE_STREAM, 0); BUG_ON(!proto); - sock_fd = my_socketat(ns, proto->fam->sock_domain, SOCK_STREAM, 0); + sock_fd = my_socketat(ns, proto->fam->sock_domain, SOCK_STREAM, proto->sock_prot); /* at first, handle common to all proto families system limits and permission related errors */ if (sock_fd == -1) {