kernel-netlink: Actually verify if the netlink message exceeds the buffer size
It might equal it and that's fine. With MSG_TRUNC we get the actual message size and can only report an error if we haven't received the complete message.
This commit is contained in:
@@ -185,8 +185,8 @@ static ssize_t read_msg(private_netlink_socket_t *this,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
len = recv(this->socket, buf, buflen, block ? 0 : MSG_DONTWAIT);
|
len = recv(this->socket, buf, buflen, MSG_TRUNC|(block ? 0 : MSG_DONTWAIT));
|
||||||
if (len == buflen)
|
if (len > buflen)
|
||||||
{
|
{
|
||||||
DBG1(DBG_KNL, "netlink response exceeds buffer size");
|
DBG1(DBG_KNL, "netlink response exceeds buffer size");
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user