In soreceive_generic() when checking if the type of mbuf has changed
check it for MT_CONTROL type too, otherwise the assertion "m->m_type == MT_DATA" below may be triggered by the following scenario: - the sender sends some data (MT_DATA) and then a file descriptor (MT_CONTROL); - the receiver calls recv(2) with a MSG_WAITALL asking for data larger than the receive buffer (uio_resid > hiwat). MFC after: 2 week
This commit is contained in:
parent
fb02ef2ab9
commit
e483d14d74
@ -1695,8 +1695,8 @@ dontblock:
|
||||
* examined ('type'), end the receive operation.
|
||||
*/
|
||||
SOCKBUF_LOCK_ASSERT(&so->so_rcv);
|
||||
if (m->m_type == MT_OOBDATA) {
|
||||
if (type != MT_OOBDATA)
|
||||
if (m->m_type == MT_OOBDATA || m->m_type == MT_CONTROL) {
|
||||
if (type != m->m_type)
|
||||
break;
|
||||
} else if (type == MT_OOBDATA)
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user