]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: tcp: process could theorically crash on lack of source ports
authorWilly Tarreau <w@1wt.eu>
Sat, 8 Dec 2012 22:03:28 +0000 (23:03 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 8 Dec 2012 22:07:33 +0000 (23:07 +0100)
commitb1719517b754aa0a098ee0f9c59e8babaf8df384
tree1e88b1caa411fa03fb980c8f82918e70a5f6fa1b
parent02777a1df5ed217f6646a49509024e35e02edc99
BUG/MEDIUM: tcp: process could theorically crash on lack of source ports

When connect() fails with EAGAIN or EADDRINUSE, an error message is
sent to logs and uses srv->id to indicate the server name (this is
very old code). Since version 1.4, it is possible to have srv == NULL,
so the message could cause a crash when connect() returns EAGAIN or
EADDRINUSE. However in practice this does not happen because on lack
of source ports, EADDRNOTAVAIL is returned instead, so this code is
never called.

This fix consists in not displaying the server name anymore, and in
adding the test for EADDRNOTAVAIL.

Also, the log level was lowered from LOG_EMERG to LOG_ERR in order
not to spam all consoles when source ports are missing for a given
target.

This fix should be backported to 1.4.
src/proto_tcp.c