mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
selftests: net: netlink-dumps: validation checks
The sanity checks are going to get silently cast to unsigned and always pass. Cast the sizeof to signed size. Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20241115003248.733862-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
0de6a472c3
commit
357c52ff86
1 changed files with 2 additions and 2 deletions
|
@ -56,10 +56,10 @@ TEST(test_sanity)
|
|||
ASSERT_EQ(n, sizeof(dump_policies));
|
||||
|
||||
n = recv(netlink_sock, buf, sizeof(buf), MSG_DONTWAIT);
|
||||
ASSERT_GE(n, sizeof(struct nlmsghdr));
|
||||
ASSERT_GE(n, (ssize_t)sizeof(struct nlmsghdr));
|
||||
|
||||
n = recv(netlink_sock, buf, sizeof(buf), MSG_DONTWAIT);
|
||||
ASSERT_GE(n, sizeof(struct nlmsghdr));
|
||||
ASSERT_GE(n, (ssize_t)sizeof(struct nlmsghdr));
|
||||
|
||||
close(netlink_sock);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue