Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / net / sctp / socket.c
index b9070736b8d9a24383be81b1764d191e854d3e63..f631c5ff4dbfd84426d140920b15650972f34646 100644 (file)
@@ -1119,9 +1119,10 @@ static int __sctp_connect(struct sock* sk,
                /* Make sure the destination port is correctly set
                 * in all addresses.
                 */
-               if (asoc && asoc->peer.port && asoc->peer.port != port)
+               if (asoc && asoc->peer.port && asoc->peer.port != port) {
+                       err = -EINVAL;
                        goto out_free;
-
+               }
 
                /* Check if there already is a matching association on the
                 * endpoint (other than the one created here).
@@ -6185,7 +6186,8 @@ unsigned int sctp_poll(struct file *file, struct socket *sock, poll_table *wait)
 
        /* Is there any exceptional events?  */
        if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
-               mask |= POLLERR;
+               mask |= POLLERR |
+                       sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? POLLPRI : 0;
        if (sk->sk_shutdown & RCV_SHUTDOWN)
                mask |= POLLRDHUP | POLLIN | POLLRDNORM;
        if (sk->sk_shutdown == SHUTDOWN_MASK)