diff options
Diffstat (limited to 'net/tipc/socket.c')
| -rw-r--r-- | net/tipc/socket.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 29e957f64458..6d4991e8f670 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
| @@ -535,7 +535,7 @@ static int send_msg(struct kiocb *iocb, struct socket *sock, | |||
| 535 | (dest->family != AF_TIPC))) | 535 | (dest->family != AF_TIPC))) |
| 536 | return -EINVAL; | 536 | return -EINVAL; |
| 537 | if ((total_len > TIPC_MAX_USER_MSG_SIZE) || | 537 | if ((total_len > TIPC_MAX_USER_MSG_SIZE) || |
| 538 | (m->msg_iovlen > (unsigned)INT_MAX)) | 538 | (m->msg_iovlen > (unsigned int)INT_MAX)) |
| 539 | return -EMSGSIZE; | 539 | return -EMSGSIZE; |
| 540 | 540 | ||
| 541 | if (iocb) | 541 | if (iocb) |
| @@ -647,7 +647,7 @@ static int send_packet(struct kiocb *iocb, struct socket *sock, | |||
| 647 | return send_msg(iocb, sock, m, total_len); | 647 | return send_msg(iocb, sock, m, total_len); |
| 648 | 648 | ||
| 649 | if ((total_len > TIPC_MAX_USER_MSG_SIZE) || | 649 | if ((total_len > TIPC_MAX_USER_MSG_SIZE) || |
| 650 | (m->msg_iovlen > (unsigned)INT_MAX)) | 650 | (m->msg_iovlen > (unsigned int)INT_MAX)) |
| 651 | return -EMSGSIZE; | 651 | return -EMSGSIZE; |
| 652 | 652 | ||
| 653 | if (iocb) | 653 | if (iocb) |
| @@ -734,8 +734,8 @@ static int send_stream(struct kiocb *iocb, struct socket *sock, | |||
| 734 | goto exit; | 734 | goto exit; |
| 735 | } | 735 | } |
| 736 | 736 | ||
| 737 | if ((total_len > (unsigned)INT_MAX) || | 737 | if ((total_len > (unsigned int)INT_MAX) || |
| 738 | (m->msg_iovlen > (unsigned)INT_MAX)) { | 738 | (m->msg_iovlen > (unsigned int)INT_MAX)) { |
| 739 | res = -EMSGSIZE; | 739 | res = -EMSGSIZE; |
| 740 | goto exit; | 740 | goto exit; |
| 741 | } | 741 | } |
| @@ -1236,7 +1236,8 @@ static u32 filter_rcv(struct sock *sk, struct sk_buff *buf) | |||
| 1236 | if (msg_mcast(msg)) | 1236 | if (msg_mcast(msg)) |
| 1237 | return TIPC_ERR_NO_PORT; | 1237 | return TIPC_ERR_NO_PORT; |
| 1238 | if (sock->state == SS_CONNECTED) { | 1238 | if (sock->state == SS_CONNECTED) { |
| 1239 | if (!msg_connected(msg)) | 1239 | if (!msg_connected(msg) || |
| 1240 | !tipc_port_peer_msg(tipc_sk_port(sk), msg)) | ||
| 1240 | return TIPC_ERR_NO_PORT; | 1241 | return TIPC_ERR_NO_PORT; |
| 1241 | } else if (sock->state == SS_CONNECTING) { | 1242 | } else if (sock->state == SS_CONNECTING) { |
| 1242 | if (!msg_connected(msg) && (msg_errcode(msg) == 0)) | 1243 | if (!msg_connected(msg) && (msg_errcode(msg) == 0)) |
| @@ -1329,7 +1330,7 @@ static u32 dispatch(struct tipc_port *tport, struct sk_buff *buf) | |||
| 1329 | if (!sock_owned_by_user(sk)) { | 1330 | if (!sock_owned_by_user(sk)) { |
| 1330 | res = filter_rcv(sk, buf); | 1331 | res = filter_rcv(sk, buf); |
| 1331 | } else { | 1332 | } else { |
| 1332 | if (sk_add_backlog(sk, buf)) | 1333 | if (sk_add_backlog(sk, buf, sk->sk_rcvbuf)) |
| 1333 | res = TIPC_ERR_OVERLOAD; | 1334 | res = TIPC_ERR_OVERLOAD; |
| 1334 | else | 1335 | else |
| 1335 | res = TIPC_OK; | 1336 | res = TIPC_OK; |
