fixup windows and older linux builds

This commit is contained in:
Brent Cook 2015-09-13 18:57:29 -05:00
parent 8c90be2a29
commit 696ba18c6a
3 changed files with 21 additions and 4 deletions

View File

@ -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

View File

@ -0,0 +1,10 @@
/*
* Public domain
* sys/socket.h compatibility shim
*/
#ifndef _WIN32
#include_next <sys/socket.h>
#else
#include <win32netcompat.h>
#endif

View File

@ -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\