]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: sock: add a check against cross worker<->master socket activities
authorWilly Tarreau <w@1wt.eu>
Wed, 4 Nov 2020 13:58:36 +0000 (14:58 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Nov 2020 14:05:50 +0000 (15:05 +0100)
Given that the previous issues caused spurious worker socket wakeups in
the master for inherited FDs that couldn't be closed, let's add a strict
test in the I/O callback to make sure that an accept() event is always
caught by the appropriate type of process (master for master listeners,
worker for worker listeners).

src/sock.c

index 3e2f208879e8028b4a90a12b21880d98de0681e1..9eff7f1049010942a1d7f1b5ad34277523685a2a 100644 (file)
@@ -621,6 +621,7 @@ void sock_accept_iocb(int fd)
        if (!l)
                return;
 
+       BUG_ON(!!master != !!(l->rx.flags & RX_F_MWORKER));
        listener_accept(l);
 }