aboutsummaryrefslogtreecommitdiff
path: root/net/netselect/files/patch-netselect.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/netselect/files/patch-netselect.c')
-rw-r--r--net/netselect/files/patch-netselect.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/net/netselect/files/patch-netselect.c b/net/netselect/files/patch-netselect.c
index 6717a97234aa..413ba24de07e 100644
--- a/net/netselect/files/patch-netselect.c
+++ b/net/netselect/files/patch-netselect.c
@@ -1,6 +1,6 @@
---- netselect.c 2001-08-29 05:18:57.000000000 -0400
-+++ netselect.c 2015-03-09 02:31:02.000000000 -0400
-@@ -39,14 +39,13 @@
+--- netselect.c.orig 2010-10-26 23:08:55 UTC
++++ netselect.c
+@@ -39,15 +39,14 @@
* hey, great! Let me know. -- apenwarr
*/
@@ -17,20 +17,21 @@
+#elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
+#if defined(__OpenBSD__)
+#include <machine/types.h>
-+#endif
-+#include <machine/endian.h>
#endif
++#include <machine/endian.h>
++#endif
#include <sys/param.h>
-@@ -152,6 +151,7 @@
+ #include <sys/time.h>
+@@ -167,6 +166,7 @@ int main(int argc, char **argv)
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 ch, seq, ttl, max_ttl = 30, num_score = 1;
+ int on = 1;
+ int use_icmp = 0;
+ unsigned int min_tries = 10;
struct timeval now;
- struct timezone tz;
- OPacket outpacket; /* last output (udp) packet */
-@@ -234,7 +234,12 @@
+@@ -280,7 +280,12 @@ int main(int argc, char **argv)
if (verbose >= 1)
fprintf(stderr, "Running netselect to choose %d out of %d address%s.\n",
num_score, numhosts, numhosts==1 ? "" : "es");
@@ -44,7 +45,7 @@
/* keep going until most of the hosts have been finished */
must_continue = numhosts;
while (must_continue && must_continue >= numhosts/2)
-@@ -712,7 +717,7 @@
+@@ -774,7 +779,7 @@ static void send_probe(int seq, int ttl, OPacket *op,
ip->ip_off = 0;
ip->ip_hl = sizeof(*ip) >> 2;
ip->ip_p = IPPROTO_UDP;
@@ -53,18 +54,15 @@
ip->ip_ttl = ttl;
ip->ip_v = IPVERSION;
ip->ip_id = htons(ident + seq);
-@@ -771,12 +776,8 @@
- int cc = 0;
+@@ -905,11 +910,7 @@ static HostData *wait_for_reply(HostData *hosts, int n
time_t msec_used;
HostData *host;
--
+
-#if !defined(__GLIBC__)
- int fromlen = sizeof(from);
-#else /* __GLIBC__ */
-- size_t fromlen = sizeof(from);
+ socklen_t fromlen = sizeof(from);
-#endif /* __GLIBC__ */
-+
-+ socklen_t fromlen = sizeof(from);
FD_ZERO(&fds);
FD_SET(sock, &fds);