connection: handle truncated control data

We can't recover from truncated control data so return a fatal error
that should stop the client. Truncated control data can happen when
there are no more fds available, for example.

See #1305
This commit is contained in:
Wim Taymans 2021-06-18 14:51:08 +02:00
parent 8cf2f134b7
commit adee3d79b9

View file

@ -186,6 +186,8 @@ static int refill_buffer(struct pw_protocol_native_connection *conn, struct buff
while (true) {
len = recvmsg(conn->fd, &msg, msg.msg_flags);
if (msg.msg_flags & MSG_CTRUNC)
return -EPROTO;
if (len == 0 && avail != 0)
return -EPIPE;
else if (len < 0) {