summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/net
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2024-11-15 01:32:48 +0100
committerJakub Kicinski <kuba@kernel.org>2024-11-19 03:42:44 +0100
commit357c52ff860b3d047de5d2c605c46dd9a8448821 (patch)
tree00b44241ce518816bf47e2d3e4caf82d194377f5 /tools/testing/selftests/net
parentnet/neighbor: clear error in case strict check is not set (diff)
downloadlinux-357c52ff860b3d047de5d2c605c46dd9a8448821.tar.xz
linux-357c52ff860b3d047de5d2c605c46dd9a8448821.zip
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>
Diffstat (limited to 'tools/testing/selftests/net')
-rw-r--r--tools/testing/selftests/net/netlink-dumps.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/net/netlink-dumps.c b/tools/testing/selftests/net/netlink-dumps.c
index 7ee6dcd334df..84e29b7dffb6 100644
--- a/tools/testing/selftests/net/netlink-dumps.c
+++ b/tools/testing/selftests/net/netlink-dumps.c
@@ -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);
}