summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Maguire <alan.maguire@oracle.com>2020-03-18 21:53:21 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-17 11:49:59 +0300
commitd2037f68ae033a6732e7aea38dcf7ae3c7fcf58d (patch)
tree1fb46af7ac701b47f12f37506b5069334c9e7dce
parent9a3f55fc0f46c0a3b54975ad573d2c9b8c7f244f (diff)
downloadlinux-d2037f68ae033a6732e7aea38dcf7ae3c7fcf58d.tar.xz
selftests/net: add definition for SOL_DCCP to fix compilation errors for old libc
[ Upstream commit 83a9b6f639e9f6b632337f9776de17d51d969c77 ] 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: 11fb60d1089f ("selftests: net: reuseport_addr_any: add DCCP") Signed-off-by: Alan Maguire <alan.maguire@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--tools/testing/selftests/net/reuseport_addr_any.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/reuseport_addr_any.c b/tools/testing/selftests/net/reuseport_addr_any.c
index c6233935fed1..b8475cb29be7 100644
--- a/tools/testing/selftests/net/reuseport_addr_any.c
+++ b/tools/testing/selftests/net/reuseport_addr_any.c
@@ -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";