Skip to content

Commit

Permalink
selftest: tcp: Fix address length in bind_wildcard.c.
Browse files Browse the repository at this point in the history
[ Upstream commit 0071d15 ]

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: 13715ac ("selftest: Add test for bind() conflicts.")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
q2ven authored and gregkh committed Sep 19, 2023
1 parent 25c757e commit 591d4ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/net/bind_wildcard.c
Expand Up @@ -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));
}

Expand Down

0 comments on commit 591d4ca

Please sign in to comment.