diff mbox series

[1/2] selftests/netfilter: use socklen_t, not a signed int, for len

Message ID 20240505214716.62304-1-jhubbard@nvidia.com (mailing list archive)
State New
Headers show
Series [1/2] selftests/netfilter: use socklen_t, not a signed int, for len | expand

Commit Message

John Hubbard May 5, 2024, 9:47 p.m. UTC
When building with clang, via:

    make LLVM=1 -C tools/testing/selftest

...clang warns about using "int *" interchangeably with "socklen_t *".

clang is correct, so fix this by declaring len as a socklen_t, instead
of as an int.

Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
 tools/testing/selftests/netfilter/sctp_collision.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


base-commit: f462ae0edd3703edd6f22fe41d336369c38b884b
prerequisite-patch-id: b901ece2a5b78503e2fb5480f20e304d36a0ea27
diff mbox series

Patch

diff --git a/tools/testing/selftests/netfilter/sctp_collision.c b/tools/testing/selftests/netfilter/sctp_collision.c
index 21bb1cfd8a85..91df996367e9 100644
--- a/tools/testing/selftests/netfilter/sctp_collision.c
+++ b/tools/testing/selftests/netfilter/sctp_collision.c
@@ -9,7 +9,8 @@ 
 int main(int argc, char *argv[])
 {
 	struct sockaddr_in saddr = {}, daddr = {};
-	int sd, ret, len = sizeof(daddr);
+	int sd, ret;
+	socklen_t len = sizeof(daddr);
 	struct timeval tv = {25, 0};
 	char buf[] = "hello";