]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: listener: set the listener's fd to -1 after deletion
authorWilly Tarreau <w@1wt.eu>
Mon, 7 Jul 2014 16:24:48 +0000 (18:24 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 7 Jul 2014 23:13:34 +0000 (01:13 +0200)
This is currently harmless, but when stopping a listener, its fd is
closed but not set to -1, so it is not possible to re-open it again.
Currently this has no impact but can have after the abstract sockets
are modified to perform a complete close on soft-reload.

The fix can be backported to 1.5 and may even apply to 1.4 (protocols.c).

src/listener.c

index ec3a39b8b6ab07faad019083b5d829abc4db36de..a82ce8109df001517dbf4a373c296fd8b72963e3 100644 (file)
@@ -236,6 +236,7 @@ int unbind_listener(struct listener *listener)
 
        if (listener->state >= LI_PAUSED) {
                fd_delete(listener->fd);
+               listener->fd = -1;
                listener->state = LI_ASSIGNED;
        }
        return ERR_NONE;