]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
tipc: fix RDM/DGRAM connect() regression
authorErik Hugne <erik.hugne@gmail.com>
Mon, 4 Mar 2019 22:26:10 +0000 (23:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Mar 2019 21:03:07 +0000 (14:03 -0700)
[ Upstream commit 0e63208915a8d7590d0a6218dadb2a6a00ac705a ]

Fix regression bug introduced in
commit 365ad353c256 ("tipc: reduce risk of user starvation during link
congestion")

Only signal -EDESTADDRREQ for RDM/DGRAM if we don't have a cached
sockaddr.

Fixes: 365ad353c256 ("tipc: reduce risk of user starvation during link congestion")
Signed-off-by: Erik Hugne <erik.hugne@gmail.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/tipc/socket.c

index e5f9f43ff15ba7e57e3968bda2eb2e5bb61a6790..75681845679ecd15c5a49949ce3b7db649a86aa0 100644 (file)
@@ -943,7 +943,7 @@ static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dlen)
 
        if (unlikely(!dest)) {
                dest = &tsk->peer;
-               if (!syn || dest->family != AF_TIPC)
+               if (!syn && dest->family != AF_TIPC)
                        return -EDESTADDRREQ;
        }