summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2020-09-24 14:46:34 +0200
committerWilly Tarreau <w@1wt.eu>2020-10-07 18:45:03 +0200
commit9bdcbc499ab2976c9421541e16f3721f27bae099 (patch)
treed40bea0d79a4fef9e016ae1831ed6fcccd4642dc
parent340fbfc4d1423fccc437d2d322c9591f03a51913 (diff)
downloadhaproxy-9bdcbc499ab2976c9421541e16f3721f27bae099.tar.gz
MINOR: listeners: check the current listener state in pause_listener()
It's better not to try to perform pause() actions on wrong states, so let's check this and make sure that all callers are now safe.
-rw-r--r--src/listener.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/listener.c b/src/listener.c
index c4ee3c319..24647a2f4 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -343,6 +343,9 @@ int pause_listener(struct listener *l)
!(proc_mask(l->rx.settings->bind_proc) & pid_bit))
goto end;
+ if (l->state < LI_READY)
+ goto end;
+
if (l->rx.proto->pause) {
/* Returns < 0 in case of failure, 0 if the listener
* was totally stopped, or > 0 if correctly paused.