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>
Sun, 10 Mar 2019 06:17:17 +0000 (07:17 +0100)
[ 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 e1bdaf0..c5614d8 100644 (file)
@@ -1318,7 +1318,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;
        }