libudev: fix check for too long packet

Don't use recvmsg(2) return value to check for too long packets
(it doesn't work) but MSG_TRUNC flag.

(David: add parantheses around condition)
This commit is contained in:
Topi Miettinen 2015-01-18 23:57:35 +02:00 committed by David Herrmann
parent 0193ad26ba
commit 9c89c1cabd

View file

@ -609,7 +609,7 @@ retry:
return NULL;
}
if (buflen < 32 || (size_t)buflen >= sizeof(buf)) {
if (buflen < 32 || (smsg.msg_flags & MSG_TRUNC)) {
log_debug("invalid message length");
return NULL;
}