sctp_server,client: drop sctp_data_io_event
sctp_data_io_event sends a sctp_sndrcvinfo control message which
is identical in meaning to sctp_rcvinfo. Right now, both are
sent which causes MSG_CTRUNC.
This just happened to work because sctp_rcvinfo is set first
in the kernel:
/* Check if we allow SCTP_RCVINFO. */
if (sp->recvrcvinfo)
sctp_ulpevent_read_rcvinfo(event, msg);
/* Check if we allow SCTP_SNDRCVINFO. */
if (sp->subscribe.sctp_data_io_event)
sctp_ulpevent_read_sndrcvinfo(event, msg);
Change-Id: I80d6a8ad374447b8cdcfbc35329f88680ac1c5f3
diff --git a/aos/network/sctp_lib.cc b/aos/network/sctp_lib.cc
index 0d31924..318c5a7 100644
--- a/aos/network/sctp_lib.cc
+++ b/aos/network/sctp_lib.cc
@@ -225,6 +225,9 @@
}
}
+ CHECK_NE(inmessage.msg_flags & MSG_CTRUNC, MSG_CTRUNC)
+ << ": Control message truncated.";
+
CHECK_LE(size, max_size) << ": Message overflowed buffer on stream "
<< result->header.rcvinfo.rcv_sid << ".";