9
0
Fork 0

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:
Holger Hans Peter Freyther 2011-01-26 11:02:42 +01:00
parent 44f848b086
commit c5562bde48
1 changed files with 1 additions and 1 deletions

View File

@ -429,7 +429,7 @@ static int m2ua_conn_read(struct bsc_fd *fd)
memset(&addr, 0, sizeof(addr));
rc = sctp_recvmsg(fd->fd, msg->data, msg->data_len,
(struct sockaddr *) &addr, &len, &info, NULL);
if (rc < 0) {
if (rc <= 0) {
LOGP(DINP, LOGL_ERROR, "Failed to read.\n");
m2ua_conn_destroy(fd->data);
return -1;