mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-12-09 11:41:00 +01:00
BUG/MINOR: proto_tcp: delete fd from fdtab if listen() fails
If listen() fails, fd should be deleted from fdtab, not just closed. Otherwise, sock_inet_bind_receiver(), which is called in loop for each receiver, will obtain the same fd via socket() for the next receiver, registered in the receivers list. Then, it will bind it again and it will try to re-insert it in fdtab, and fd_insert() will trigger the BUG_ON(fdtab[fd].owner != NULL) check. When tcp_bind_listener() code was implemented, the use of fd_delete() was not generalized and this one remained overlooked. This can be backported to all stable versions.
This commit is contained in:
parent
8427c5b542
commit
308c6881c0
@ -694,7 +694,7 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen)
|
||||
tcp_close_return:
|
||||
free_trash_chunk(msg);
|
||||
msg = NULL;
|
||||
close(fd);
|
||||
fd_delete(fd);
|
||||
tcp_return:
|
||||
if (msg && errlen && msg->data) {
|
||||
char pn[INET6_ADDRSTRLEN];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user