Skip to content

Commit

Permalink
selftests/net: fix warnings on reuseaddr_ports_exhausted
Browse files Browse the repository at this point in the history
[ Upstream commit 81f711d ]

Fix multiple warnings seen with gcc 10.2.1:
reuseaddr_ports_exhausted.c:32:41: warning: missing braces around initializer [-Wmissing-braces]
   32 | struct reuse_opts unreusable_opts[12] = {
      |                                         ^
   33 |  {0, 0, 0, 0},
      |   {   } {   }

Fixes: 7f204a7 ("selftests: net: Add SO_REUSEADDR test to check if 4-tuples are fully utilized.")
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Carlos Llamas authored and gregkh committed Mar 30, 2021
1 parent 331d42f commit 9aefd55
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions tools/testing/selftests/net/reuseaddr_ports_exhausted.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,25 @@ struct reuse_opts {
};

struct reuse_opts unreusable_opts[12] = {
{0, 0, 0, 0},
{0, 0, 0, 1},
{0, 0, 1, 0},
{0, 0, 1, 1},
{0, 1, 0, 0},
{0, 1, 0, 1},
{0, 1, 1, 0},
{0, 1, 1, 1},
{1, 0, 0, 0},
{1, 0, 0, 1},
{1, 0, 1, 0},
{1, 0, 1, 1},
{{0, 0}, {0, 0}},
{{0, 0}, {0, 1}},
{{0, 0}, {1, 0}},
{{0, 0}, {1, 1}},
{{0, 1}, {0, 0}},
{{0, 1}, {0, 1}},
{{0, 1}, {1, 0}},
{{0, 1}, {1, 1}},
{{1, 0}, {0, 0}},
{{1, 0}, {0, 1}},
{{1, 0}, {1, 0}},
{{1, 0}, {1, 1}},
};

struct reuse_opts reusable_opts[4] = {
{1, 1, 0, 0},
{1, 1, 0, 1},
{1, 1, 1, 0},
{1, 1, 1, 1},
{{1, 1}, {0, 0}},
{{1, 1}, {0, 1}},
{{1, 1}, {1, 0}},
{{1, 1}, {1, 1}},
};

int bind_port(struct __test_metadata *_metadata, int reuseaddr, int reuseport)
Expand Down

0 comments on commit 9aefd55

Please sign in to comment.