sctp: Close the socket if we get <= 0 as a result for sctp_rcvmsg
The manpage says that -1 is the indication for error but on 2.6.12 we just ended up in a infinite loop as select shows the socket as readable but a recvmsg does not give any data.
This commit is contained in:
parent
44f848b086
commit
c5562bde48
|
@ -429,7 +429,7 @@ static int m2ua_conn_read(struct bsc_fd *fd)
|
||||||
memset(&addr, 0, sizeof(addr));
|
memset(&addr, 0, sizeof(addr));
|
||||||
rc = sctp_recvmsg(fd->fd, msg->data, msg->data_len,
|
rc = sctp_recvmsg(fd->fd, msg->data, msg->data_len,
|
||||||
(struct sockaddr *) &addr, &len, &info, NULL);
|
(struct sockaddr *) &addr, &len, &info, NULL);
|
||||||
if (rc < 0) {
|
if (rc <= 0) {
|
||||||
LOGP(DINP, LOGL_ERROR, "Failed to read.\n");
|
LOGP(DINP, LOGL_ERROR, "Failed to read.\n");
|
||||||
m2ua_conn_destroy(fd->data);
|
m2ua_conn_destroy(fd->data);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Reference in New Issue