MINOR: tcp: When binding socket, attempt to reuse one from the old proc.
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 5 Apr 2017 20:39:56 +0000 (22:39 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 13 Apr 2017 17:15:17 +0000 (19:15 +0200)
commit153659f1ae69a1741109fcb95cac2c7d64f99a29
tree9cfb7680b0a8c8eed1d17186cf3b73d44e4b3d15
parentf73629d23a44995f84887859fcbc7d22a2227eec
MINOR: tcp: When binding socket, attempt to reuse one from the old proc.

Try to reuse any socket from the old process, provided by the "-x" flag,
before binding a new one, assuming it is compatible.
"Compatible" here means same address and port, same namspace if any,
same interface if any, and that the following flags are the same :
LI_O_FOREIGN, LI_O_V6ONLY and LI_O_V4V6.
Also change tcp_bind_listener() to always enable/disable socket options,
instead of just doing so if it is in the configuration file, as the option
may have been removed, ie TCP_FASTOPEN may have been set in the old process,
and removed from the new configuration, so we have to disable it.
src/proto_tcp.c