diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /net-analyzer/netselect/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'net-analyzer/netselect/files')
4 files changed, 135 insertions, 0 deletions
diff --git a/net-analyzer/netselect/files/netselect-0.3-bsd.patch b/net-analyzer/netselect/files/netselect-0.3-bsd.patch new file mode 100644 index 000000000000..e9624d87215a --- /dev/null +++ b/net-analyzer/netselect/files/netselect-0.3-bsd.patch @@ -0,0 +1,56 @@ +--- a/netselect.c ++++ b/netselect.c +@@ -39,14 +39,14 @@ + * hey, great! Let me know. -- apenwarr + */ + +-#ifdef __EMX__ +-# include <io.h> +-# include <fcntl.h> +-# include <sys/types.h> +-# include <sys/select.h> +-# include <machine/endian.h> +-#else +-# include <endian.h> ++#ifdef __linux__ ++#include <endian.h> ++#include <sys/types.h> ++#elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) ++#if defined(__OpenBSD__) ++#include <machine/types.h> ++#endif ++#include <machine/endian.h> + #endif + + #include <sys/param.h> +@@ -152,6 +152,7 @@ + extern int optind; + int hostcount, startcount, endcount = 0, sent_one, lag, min_lag = 100; + int ch, seq, ttl, max_ttl = 30, min_tries = 10, num_score = 1; ++ int on = 1; + struct timeval now; + struct timezone tz; + OPacket outpacket; /* last output (udp) packet */ +@@ -234,7 +235,12 @@ + if (verbose >= 1) + fprintf(stderr, "Running netselect to choose %d out of %d address%s.\n", + num_score, numhosts, numhosts==1 ? "" : "es"); +- ++ ++ if (setsockopt(sndsock, IPPROTO_IP, IP_HDRINCL, &on, sizeof(on)) < 0) { ++ perror("IP_HDRINCL"); ++ _exit(EXIT_FAILURE); ++ } ++ + /* keep going until most of the hosts have been finished */ + must_continue = numhosts; + while (must_continue && must_continue >= numhosts/2) +@@ -712,7 +718,7 @@ + ip->ip_off = 0; + ip->ip_hl = sizeof(*ip) >> 2; + ip->ip_p = IPPROTO_UDP; +- ip->ip_len = 0; /* kernel fills this in */ ++ ip->ip_len = sizeof(OPacket); + ip->ip_ttl = ttl; + ip->ip_v = IPVERSION; + ip->ip_id = htons(ident + seq); diff --git a/net-analyzer/netselect/files/netselect-0.3-glibc.patch b/net-analyzer/netselect/files/netselect-0.3-glibc.patch new file mode 100644 index 000000000000..053e5865b341 --- /dev/null +++ b/net-analyzer/netselect/files/netselect-0.3-glibc.patch @@ -0,0 +1,11 @@ +--- a/netselect.c ++++ b/netselect.c +@@ -780,7 +780,7 @@ + #if !defined(__GLIBC__) + int fromlen = sizeof(from); + #else /* __GLIBC__ */ +- size_t fromlen = sizeof(from); ++ socklen_t fromlen = sizeof(from); + #endif /* __GLIBC__ */ + + FD_ZERO(&fds); diff --git a/net-analyzer/netselect/files/netselect-0.4-bsd.patch b/net-analyzer/netselect/files/netselect-0.4-bsd.patch new file mode 100644 index 000000000000..fd49a17682db --- /dev/null +++ b/net-analyzer/netselect/files/netselect-0.4-bsd.patch @@ -0,0 +1,56 @@ +--- a/netselect.c ++++ b/netselect.c +@@ -39,14 +39,14 @@ + * hey, great! Let me know. -- apenwarr + */ + +-#ifdef __EMX__ +-# include <io.h> +-# include <fcntl.h> +-# include <sys/types.h> +-# include <sys/select.h> +-# include <machine/endian.h> +-#else +-# include <endian.h> ++#ifdef __linux__ ++#include <endian.h> ++#include <sys/types.h> ++#elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) ++#if defined(__OpenBSD__) ++#include <machine/types.h> ++#endif ++#include <machine/endian.h> + #endif + + #include <sys/param.h> +@@ -167,6 +167,7 @@ + extern int optind; + int hostcount, startcount, endcount = 0, sent_one, lag, min_lag = 100; + int ch, seq, ttl, max_ttl = 30, num_score = 1; ++ int on = 1; + int use_icmp = 0; + unsigned int min_tries = 10; + struct timeval now; +@@ -234,7 +235,12 @@ + if (verbose >= 1) + fprintf(stderr, "Running netselect to choose %d out of %d address%s.\n", + num_score, numhosts, numhosts==1 ? "" : "es"); +- ++ ++ if (setsockopt(sndsock, IPPROTO_IP, IP_HDRINCL, &on, sizeof(on)) < 0) { ++ perror("IP_HDRINCL"); ++ _exit(EXIT_FAILURE); ++ } ++ + /* keep going until most of the hosts have been finished */ + must_continue = numhosts; + while (must_continue && must_continue >= numhosts/2) +@@ -712,7 +718,7 @@ + ip->ip_off = 0; + ip->ip_hl = sizeof(*ip) >> 2; + ip->ip_p = IPPROTO_UDP; +- ip->ip_len = 0; /* kernel fills this in */ ++ ip->ip_len = sizeof(OPacket); + ip->ip_ttl = ttl; + ip->ip_v = IPVERSION; + ip->ip_id = htons(ident + seq); diff --git a/net-analyzer/netselect/files/netselect-0.4-flags.patch b/net-analyzer/netselect/files/netselect-0.4-flags.patch new file mode 100644 index 000000000000..ffcfead8eb3a --- /dev/null +++ b/net-analyzer/netselect/files/netselect-0.4-flags.patch @@ -0,0 +1,12 @@ +--- a/Makefile ++++ b/Makefile +@@ -3,8 +3,7 @@ + MANDEST = ${PREFIX}/man/man1 + + CC = gcc +-CFLAGS = -O2 -Wall -I. -g +-LDFLAGS = -g ++CFLAGS += -Wall -I. + LIBS = + + ifdef OS2 |