aboutsummaryrefslogtreecommitdiffstats
path: root/audio/knapster
diff options
context:
space:
mode:
authorjedgar <jedgar@FreeBSD.org>2000-10-25 08:47:02 +0800
committerjedgar <jedgar@FreeBSD.org>2000-10-25 08:47:02 +0800
commitfea24dbb8dfc1467368ebccd106285202118bfa6 (patch)
tree1f587989a49f778a82d6a2b5fba344403618f73a /audio/knapster
parent73430d49780fb7cb72f9fbcae0e8906811dfdfe4 (diff)
downloadfreebsd-ports-graphics-fea24dbb8dfc1467368ebccd106285202118bfa6.tar.gz
freebsd-ports-graphics-fea24dbb8dfc1467368ebccd106285202118bfa6.tar.zst
freebsd-ports-graphics-fea24dbb8dfc1467368ebccd106285202118bfa6.zip
Oops, forgot the new patch....
Update port to 0.13 Submitted by: David K. Phinney <dave@insinc.ca>
Diffstat (limited to 'audio/knapster')
-rw-r--r--audio/knapster/files/patch-aj96
1 files changed, 96 insertions, 0 deletions
diff --git a/audio/knapster/files/patch-aj b/audio/knapster/files/patch-aj
new file mode 100644
index 00000000000..cbff9400cae
--- /dev/null
+++ b/audio/knapster/files/patch-aj
@@ -0,0 +1,96 @@
+--- knapster/icmp.cpp.orig Tue Jul 25 04:09:45 2000
++++ knapster/icmp.cpp Sun Oct 15 02:43:08 2000
+@@ -30,6 +30,7 @@
+ #include <sys/file.h>
+ #include <sys/time.h>
+
++#include <netinet/in_systm.h>
+ #include <netinet/ip.h>
+ #include <netinet/ip_icmp.h>
+ #include <arpa/inet.h>
+@@ -39,6 +40,17 @@
+ #include <errno.h>
+ #include <string.h>
+
++/*
++ * Linux compatibility crap.
++ */
++
++#ifndef ICMP_DEST_UNREACH
++#define ICMP_DEST_UNREACH ICMP_UNREACH
++#endif
++#ifndef ICMP_TIME_EXCEEDED
++#define ICMP_TIME_EXCEEDED ICMP_TIMXCEED
++#endif
++
+ // Default length of the data in the icmp packet.
+ #define DATALEN (64 - 8)
+
+@@ -78,7 +90,7 @@
+ // Packet data ... note that it is uninitialized, and the 1st bit will
+ // be used for time info
+ u_char outpack[65535 - 60 - 8]; // Max packet size (???)
+- struct icmphdr *icp;
++ struct icmp *icp;
+
+ if (IcmpPing::rawSkt < 0)
+ return;
+@@ -88,18 +100,18 @@
+ to->sin_family = AF_INET;
+ to->sin_addr.s_addr = ip_addr;
+
+- icp = (struct icmphdr *)outpack;
+- icp->type = ICMP_ECHO;
+- icp->code = 0;
+- icp->checksum = 0;
+- icp->un.echo.sequence = 0; // Assuming we only transfer one to each host
+- icp->un.echo.id = 0; // Not using ID...
++ icp = (struct icmp *)outpack;
++ icp->icmp_type = ICMP_ECHO;
++ icp->icmp_code = 0;
++ icp->icmp_cksum = 0;
++ icp->icmp_hun.ih_idseq.icd_seq = 0; // Assuming we only transfer one to each host
++ icp->icmp_hun.ih_idseq.icd_id = 0; // Not using ID...
+
+ // Insert time into packet
+ gettimeofday((struct timeval *)&outpack[8],
+ (struct timezone *)NULL);
+
+- icp->checksum = in_cksum((u_short *)icp, DATALEN + 8);
++ icp->icmp_cksum = in_cksum((u_short *)icp, DATALEN + 8);
+
+ // would the MSG_DONTWAIT flag speed this up?
+ sendto(IcmpPing::rawSkt, (char *)outpack, DATALEN + 8, 0,
+@@ -118,8 +130,8 @@
+ int pktSize;
+ size_t fromlen;
+ u_char packet[PKTLEN];
+- struct iphdr *ip;
+- struct icmphdr *icp;
++ struct ip *ip;
++ struct icmp *icp;
+ int hdrLen;
+ struct timeval curTime, *pktTime;
+
+@@ -137,11 +149,11 @@
+ else
+ {
+ // TODO: add check for packet length
+- ip = (struct iphdr *) packet;
+- hdrLen = ip->ihl << 2;
+- icp = (struct icmphdr *)(packet + hdrLen);
++ ip = (struct ip *) packet;
++ hdrLen = ip->ip_hl << 2;
++ icp = (struct icmp *)(packet + hdrLen);
+
+- switch (icp->type) {
++ switch (icp->icmp_type) {
+ case ICMP_ECHOREPLY :
+ gettimeofday(&curTime, (struct timezone *) NULL);
+
+@@ -217,4 +229,4 @@
+ out->tv_usec += 1000000;
+ }
+ out->tv_sec -= in->tv_sec;
+-}
++}