]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: sockpair: wrong return value for fd_send_uxst()
authorWilliam Lallemand <wlallemand@haproxy.org>
Mon, 25 Jul 2022 13:51:30 +0000 (15:51 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 25 Jul 2022 14:10:58 +0000 (16:10 +0200)
The fd_send_uxst() function which is used to send a socket over the
socketpair returns 1 upon error instead of -1, which means the error
case of the sendmsg() is never catched correctly.

Must be backported as far as 1.9.

src/proto_sockpair.c

index 282a094bf36da596cfbd8052f8508a5876f91e68..60880b290514576d3947cb9167367c102fed8bd2 100644 (file)
@@ -246,7 +246,7 @@ int send_fd_uxst(int fd, int send_fd)
 
        if (sendmsg(fd, &msghdr, 0) != sizeof(iobuf)) {
                ha_warning("Failed to transfer socket\n");
-               return 1;
+               return -1;
        }
 
        return 0;