]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: tools: preset the port of fd-based "sockets" to zero
authorWilly Tarreau <w@1wt.eu>
Sat, 15 Dec 2018 14:40:12 +0000 (15:40 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 15 Dec 2018 14:40:12 +0000 (15:40 +0100)
commit0205a4e0b51287959f329f6a00f432e4d48de346
treefb87b804d56bb9df0b58c77a051d915a2542b2c2
parentcc79ed28f6d6931a3c87c0d3ab397b8dae20bbbd
MINOR: tools: preset the port of fd-based "sockets" to zero

Addresses made of a file descriptor store the file descriptor into the
address part of a sin_addr. Contrary to other address classes, there's
no way to figure later based on the FD if an initialization was done
(which is how logs initialize their FDs). The port part is currently
left with random data, so let's instead specifically set the port part
to zero when creating an FD, and let the code using it set whatever
info it needs there, typically an initialization state.
src/standard.c