From: Willy Tarreau Date: Sun, 27 Jan 2019 17:34:12 +0000 (+0100) Subject: BUG/MINOR: listener: always fill the source address for accepted socketpairs X-Git-Tag: v2.0-dev1~149 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=888d5678f7829e0685d0f692cdb159e655ac0e25;p=thirdparty%2Fhaproxy.git BUG/MINOR: listener: always fill the source address for accepted socketpairs The source address was not set but passed down the chain to the upper layer's accept() calls. Let's initialize it like other UNIX sockets in this case. At the moment it should not have any impact since socketpairs are only usable for the master CLI. This should be backported to 1.9. --- diff --git a/src/listener.c b/src/listener.c index 9a79e6aba3..553607af76 100644 --- a/src/listener.c +++ b/src/listener.c @@ -545,6 +545,9 @@ void listener_accept(int fd) if (unlikely(l->addr.ss_family == AF_CUST_SOCKPAIR)) { if ((cfd = recv_fd_uxst(fd)) != -1) fcntl(cfd, F_SETFL, O_NONBLOCK); + /* just like with UNIX sockets, only the family is filled */ + addr.ss_family = AF_UNIX; + laddr = sizeof(addr.ss_family); } else #ifdef USE_ACCEPT4