mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-29 06:40:59 +01:00
BUG/MINOR: proto_uxst: delete fd from fdtab if listen() fails
This patch is done mostly as a safeguard in order not to trigger BUG_ON(fdtab[fd].owner != NULL) check, if listen() will fail on UNIX domain socket. In uxst_bind_listener(), the pretty same logic of closing socket on error path was kept, as it was in tcp_bind_listener() before. The use of fd_delete() was not generalized, when the support of UNIX sock_stream protocol was implemented. So, let's remove fd from fdtab on failure, instead of closing it. Otherwise, uxst_bind_listener(), which could be called in loop for each receiver, will obtain the same fd via socket() for the next receiver. Then, it will bind it again and it will try to re-insert it in fdtab. This can be backported to all stable versions.
This commit is contained in:
parent
f3c75a52df
commit
eb82358690
@ -143,7 +143,7 @@ static int uxst_bind_listener(struct listener *listener, char *errmsg, int errle
|
|||||||
return err;
|
return err;
|
||||||
|
|
||||||
uxst_close_return:
|
uxst_close_return:
|
||||||
close(fd);
|
fd_delete(fd);
|
||||||
uxst_return:
|
uxst_return:
|
||||||
if (msg && errlen) {
|
if (msg && errlen) {
|
||||||
char *path_str;
|
char *path_str;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user