lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sun,  5 May 2024 14:47:15 -0700
From: John Hubbard <jhubbard@...dia.com>
To: Shuah Khan <shuah@...nel.org>
Cc: Phil Sutter <phil@....cc>,
	Pablo Neira Ayuso <pablo@...filter.org>,
	Florian Westphal <fw@...len.de>,
	Felix Huettner <felix.huettner@...l.schwarz>,
	Max Lamprecht <max.lamprecht@...l.schwarz>,
	Luca Czesla <luca.czesla@...l.schwarz>,
	Xin Long <lucien.xin@...il.com>,
	"David S . Miller" <davem@...emloft.net>,
	Paul Moore <paul@...l-moore.com>,
	Richard Guy Briggs <rgb@...hat.com>,
	Boris Sukholitko <boris.sukholitko@...adcom.com>,
	Valentin Obst <kernel@...entinobst.de>,
	linux-kselftest@...r.kernel.org,
	LKML <linux-kernel@...r.kernel.org>,
	llvm@...ts.linux.dev,
	John Hubbard <jhubbard@...dia.com>
Subject: [PATCH 1/2] selftests/netfilter: use socklen_t, not a signed int, for len

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@...dia.com>
---
 tools/testing/selftests/netfilter/sctp_collision.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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";
 

base-commit: f462ae0edd3703edd6f22fe41d336369c38b884b
prerequisite-patch-id: b901ece2a5b78503e2fb5480f20e304d36a0ea27
-- 
2.45.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ