]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proto_tcp: also report the attempted MSS values in error message
authorWilly Tarreau <w@1wt.eu>
Thu, 14 Oct 2021 09:39:18 +0000 (11:39 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 14 Oct 2021 19:22:52 +0000 (21:22 +0200)
The MSS errors are the only ones not indicating what was attempted, let's
report the value that was tried, as it can help users spot them in the
config (particularly if a default value was used).

src/proto_tcp.c

index 0ffe56c64ba5ffdddf17d2adf7cc9dba9a410ff6..95466538b23c46498c7ec9a3070858d68bbd3414 100644 (file)
@@ -621,7 +621,7 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen)
        if (listener->maxseg > 0) {
                if (setsockopt(fd, IPPROTO_TCP, TCP_MAXSEG,
                               &listener->maxseg, sizeof(listener->maxseg)) == -1) {
-                       chunk_appendf(msg, "%scannot set MSS", msg->data ? ", " : "");
+                       chunk_appendf(msg, "%scannot set MSS to %d", msg->data ? ", " : "", listener->maxseg);
                        err |= ERR_WARN;
                }
        } else {
@@ -639,7 +639,7 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen)
                if (defaultmss > 0 &&
                    tmpmaxseg != defaultmss &&
                    setsockopt(fd, IPPROTO_TCP, TCP_MAXSEG, &defaultmss, sizeof(defaultmss)) == -1) {
-                       chunk_appendf(msg, "%scannot set MSS", msg->data ? ", " : "");
+                       chunk_appendf(msg, "%scannot set MSS to %d", msg->data ? ", " : "", defaultmss);
                        err |= ERR_WARN;
                }
        }