selftest: tcp: Fix address length in bind_wildcard.c.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Mon, 11 Sep 2023 18:36:58 +0000 (11:36 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Sep 2023 06:18:04 +0000 (07:18 +0100)
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 <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/bind_wildcard.c

index 58edfc1..e7ebe72 100644 (file)
@@ -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));
 }