From 696ba18c6ab02ded424aa4d87712064eba82f804 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Sun, 13 Sep 2015 18:57:29 -0500 Subject: fixup windows and older linux builds --- include/Makefile.am | 1 + include/compat/sys/socket.h | 10 ++++++++++ patches/netcat.c.patch | 14 ++++++++++---- 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 include/compat/sys/socket.h diff --git a/include/Makefile.am b/include/Makefile.am index 929ff7d..24a83cf 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -31,6 +31,7 @@ noinst_HEADERS += compat/sys/ioctl.h noinst_HEADERS += compat/sys/mman.h noinst_HEADERS += compat/sys/param.h noinst_HEADERS += compat/sys/select.h +noinst_HEADERS += compat/sys/socket.h noinst_HEADERS += compat/sys/stat.h noinst_HEADERS += compat/sys/time.h noinst_HEADERS += compat/sys/types.h diff --git a/include/compat/sys/socket.h b/include/compat/sys/socket.h new file mode 100644 index 0000000..17e84f1 --- /dev/null +++ b/include/compat/sys/socket.h @@ -0,0 +1,10 @@ +/* + * Public domain + * sys/socket.h compatibility shim + */ + +#ifndef _WIN32 +#include_next +#else +#include +#endif diff --git a/patches/netcat.c.patch b/patches/netcat.c.patch index c5206f6..1c6565f 100644 --- a/patches/netcat.c.patch +++ b/patches/netcat.c.patch @@ -1,5 +1,5 @@ --- apps/nc/netcat.c.orig Sun Sep 13 08:12:39 2015 -+++ apps/nc/netcat.c Sun Sep 13 16:39:51 2015 ++++ apps/nc/netcat.c Sun Sep 13 18:56:27 2015 @@ -98,9 +98,13 @@ int Dflag; /* sodebug */ int Iflag; /* TCP receive buffer size */ @@ -83,7 +83,7 @@ memset(&ahints, 0, sizeof(struct addrinfo)); ahints.ai_family = res0->ai_family; ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; -@@ -887,9 +902,11 @@ +@@ -887,13 +902,17 @@ res0->ai_protocol)) < 0) continue; @@ -93,9 +93,15 @@ err(1, "setsockopt SO_RTABLE"); +#endif ++#ifdef SO_REUSEPORT ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x)); if (ret == -1) -@@ -1337,11 +1354,13 @@ + err(1, NULL); ++#endif + + set_common_sockopts(s, res0->ai_family); + +@@ -1337,11 +1356,13 @@ { int x = 1; @@ -109,7 +115,7 @@ if (Dflag) { if (setsockopt(s, SOL_SOCKET, SO_DEBUG, &x, sizeof(x)) == -1) -@@ -1516,15 +1535,19 @@ +@@ -1516,15 +1537,19 @@ \t-P proxyuser\tUsername for proxy authentication\n\ \t-p port\t Specify local port for remote connects\n\ \t-R CAfile CA bundle\n\ -- cgit v1.2.3-55-g6feb