Skip to contentSkip to conversation

netstress: Add imports for TCP_FASTOPEN definition

PATCH New Petr Vorel 2 participants 2 messages Oct 31, 2017 – Nov 8, 2017

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 netstress: Add imports for TCP_FASTOPEN definition

+ add necessary autoconf checks for these headers.

---
 configure.ac                            | 2 ++
 testcases/network/netstress/netstress.c | 8 ++++++++
 2 files changed, 10 insertions(+)
configure.ac +2 -0
index 5f1cd3bfb..1f1f53eb0 100644
@@ -39,7 +39,9 @@ AC_CHECK_HEADERS([ \
     linux/mempolicy.h \
     linux/module.h \
     linux/netlink.h \
+    linux/tcp.h \
     mm.h \
+    netinet/tcp.h \
     pthread.h \
     sys/epoll.h \
     sys/fanotify.h \
testcases/network/netstress/netstress.c +8 -0
index 4b211aa75..5e3aca1a1 100644
@@ -18,6 +18,8 @@
  *
  */
 
+#include "config.h"
+
 #include <pthread.h>
 #include <stdlib.h>
 #include <limits.h>
@@ -32,6 +34,12 @@
 #include <unistd.h>
 #include <errno.h>
 
+#ifdef HAVE_LINUX_TCP_H
+#include <linux/tcp.h>
+#elif defined(HAVE_NETINET_TCP_H)
+#include <netinet/tcp.h>
+#endif
+
 #include "lapi/posix_clocks.h"
 #include "tst_safe_pthread.h"
 #include "tst_test.h"
Signature · 1 line
2.14.2
#1 lore raw

PATCH 1/1 netstress: Add imports for TCP_FASTOPEN definition

Quoted 1 line · Petr Vorel

+ add necessary autoconf checks for these headers.

Looks good but I wouldn't include it in the test itself but move these defines with your changes into lapi/tcp.h, others like MSG_FASTOPEN, SOL_DCCP, SO_BUSY_POLL can be moved to lapi/socket.h.

Thanks,
Alexey