Skip to content

Commit

Permalink
selftests/net: add definition for SOL_DCCP to fix compilation errors …
Browse files Browse the repository at this point in the history
…for old libc

Many systems build/test up-to-date kernels with older libcs, and
an older glibc (2.17) lacks the definition of SOL_DCCP in
/usr/include/bits/socket.h (it was added in the 4.6 timeframe).

Adding the definition to the test program avoids a compilation
failure that gets in the way of building tools/testing/selftests/net.
The test itself will work once the definition is added; either
skipping due to DCCP not being configured in the kernel under test
or passing, so there are no other more up-to-date glibc dependencies
here it seems beyond that missing definition.

Fixes: 11fb60d ("selftests: net: reuseport_addr_any: add DCCP")
Signed-off-by: Alan Maguire <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
alan-maguire authored and davem330 committed Mar 22, 2020
1 parent 9a9ba2a commit 83a9b6f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/testing/selftests/net/reuseport_addr_any.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
#include <sys/socket.h>
#include <unistd.h>

#ifndef SOL_DCCP
#define SOL_DCCP 269
#endif

static const char *IP4_ADDR = "127.0.0.1";
static const char *IP6_ADDR = "::1";
static const char *IP4_MAPPED6 = "::ffff:127.0.0.1";
Expand Down

0 comments on commit 83a9b6f

Please sign in to comment.