Commit 0071d155 authored by Kuniyuki Iwashima's avatar Kuniyuki Iwashima Committed by David S. Miller

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: 13715acf ("selftest: Add test for bind() conflicts.")
Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c48ef9c4
...@@ -100,7 +100,7 @@ void bind_sockets(struct __test_metadata *_metadata, ...@@ -100,7 +100,7 @@ void bind_sockets(struct __test_metadata *_metadata,
TEST_F(bind_wildcard, v4_v6) TEST_F(bind_wildcard, v4_v6)
{ {
bind_sockets(_metadata, self, 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)); (struct sockaddr *)&self->addr6, sizeof(self->addr6));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment