From: Kuniyuki Iwashima Date: Mon, 11 Sep 2023 18:36:58 +0000 (-0700) Subject: selftest: tcp: Fix address length in bind_wildcard.c. X-Git-Tag: v6.6.7~1907^2~4^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0071d15517b4a3d265abc00395beb1138e7236c7;p=platform%2Fkernel%2Flinux-starfive.git selftest: tcp: Fix address length in bind_wildcard.c. The selftest passes the IPv6 address length for an IPv4 address. We should pass the correct length. Note inet_bind_sk() does not check if the size is larger than sizeof(struct sockaddr_in), so there is no real bug in this selftest. Fixes: 13715acf8ab5 ("selftest: Add test for bind() conflicts.") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller --- diff --git a/tools/testing/selftests/net/bind_wildcard.c b/tools/testing/selftests/net/bind_wildcard.c index 58edfc1..e7ebe72 100644 --- a/tools/testing/selftests/net/bind_wildcard.c +++ b/tools/testing/selftests/net/bind_wildcard.c @@ -100,7 +100,7 @@ void bind_sockets(struct __test_metadata *_metadata, TEST_F(bind_wildcard, v4_v6) { bind_sockets(_metadata, self, - (struct sockaddr *)&self->addr4, sizeof(self->addr6), + (struct sockaddr *)&self->addr4, sizeof(self->addr4), (struct sockaddr *)&self->addr6, sizeof(self->addr6)); }