summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer/paketto/files/1.10-gcc4.patch')
-rw-r--r--net-analyzer/paketto/files/1.10-gcc4.patch158
1 files changed, 158 insertions, 0 deletions
diff --git a/net-analyzer/paketto/files/1.10-gcc4.patch b/net-analyzer/paketto/files/1.10-gcc4.patch
new file mode 100644
index 000000000000..ef0e79328149
--- /dev/null
+++ b/net-analyzer/paketto/files/1.10-gcc4.patch
@@ -0,0 +1,158 @@
+diff --exclude='*~' -Naur src.orig/lc.c src/lc.c
+--- src.orig/lc.c 2006-07-26 14:30:24.000000000 -0700
++++ src/lc.c 2006-07-26 14:37:34.000000000 -0700
+@@ -190,7 +190,7 @@
+ break;
+ case 'h':
+ if(sniff_file[0]=='-' &&
+- sniff_file[1]==0) (void *)sniff.dump = stdout;
++ sniff_file[1]==0) sniff.dump = stdout;
+ else sniff.dump = (void *)fopen(sniff_file, "w");
+ if(!sniff.dump){
+ fprintf(stderr, "Couldn't open file: %s\n", sniff.dump);
+@@ -223,7 +223,7 @@
+ break;
+ case 'h':
+ if(spoof_file[0]=='-' &&
+- spoof_file[1]==0) (void *)spoof.pcap = stdin;
++ spoof_file[1]==0) spoof.pcap = stdin;
+ else spoof.pcap = (void *)fopen(spoof_file, "r");
+ if(!spoof.pcap){
+ fprintf(stderr, "Couldn't open file: %s\n", spoof.pcap);
+@@ -244,7 +244,7 @@
+ i=1;
+ if(!pid){
+ if(sniff_packets){
+- (void *)sniff.packet = pcap_next(sniff.pcap, &(sniff.pkthdr));
++ sniff.packet = pcap_next(sniff.pcap, &(sniff.pkthdr));
+ if(!sniff.packet) continue; /* network has "infinite packets, but there's blocking */
+ if(trailer_sniff){
+ pk_hmac(buf, sniff_key, sniff.packet, sniff.pkthdr.caplen-21);
+diff --exclude='*~' -Naur src.orig/minewt.c src/minewt.c
+--- src.orig/minewt.c 2006-07-26 14:28:11.000000000 -0700
++++ src/minewt.c 2006-07-26 14:37:34.000000000 -0700
+@@ -599,7 +599,7 @@
+ /* XXX very probable security hole lives here -- we must validate length, at minimum*/
+ if(stateless_ipt &&
+ (x.ip->ip_hl*4) != LIBNET_IP_H){
+- (char *)packet_state = (char *)x.ip + LIBNET_IP_H + 4;
++ packet_state = (char *)x.ip + LIBNET_IP_H + 4;
+ }
+
+ if(packet_state || (packet_state = find_entry(packet_key)))
+diff --exclude='*~' -Naur src.orig/paketto.c src/paketto.c
+--- src.orig/paketto.c 2006-07-26 14:24:27.000000000 -0700
++++ src/paketto.c 2006-07-26 14:37:34.000000000 -0700
+@@ -109,7 +109,7 @@
+ if(datalink != DLT_EN10MB) return(0); /* validate is our ethernet */
+ if(length < LIBNET_ETH_H) return(0); /* validate can be ethernet */
+
+- (char *)x->eth = (char *)packet;
++ x->eth = (char *)packet;
+ l2_offset=LIBNET_ETH_H;
+ ok += l2_offset;
+
+@@ -118,7 +118,7 @@
+ case ETHERTYPE_ARP:
+ if(length < LIBNET_ETH_H + LIBNET_ARP_H)
+ return(0);
+- (char *)x->arp = (char *)x->eth + LIBNET_ETH_H;
++ x->arp = (char *)x->eth + LIBNET_ETH_H;
+ ok+=LIBNET_ARP_H;
+ return(ok);
+ break;
+@@ -133,8 +133,8 @@
+ if(length < l2_offset + LIBNET_IP_H) /* Could we be IP? */
+ return(0);
+ ok+=LIBNET_IP_H;
+- if(x->eth) (char *)x->ip = (char *)x->eth + l2_offset;
+- else (char *)x->ip = (char *)packet;
++ if(x->eth) x->ip = (char *)x->eth + l2_offset;
++ else x->ip = (char *)packet;
+
+ if(x->ip->ip_off != 0 && x->ip->ip_off != ntohs(16384)) return(0);
+ if(x->ip->ip_v != 4) return(0);
+@@ -164,19 +164,19 @@
+ return(0);
+ ok+=LIBNET_TCP_H;
+ }
+- (char *)x->tcp = (char *)x->ip + ((int)x->ip->ip_hl*4);
++ x->tcp = (char *)x->ip + ((int)x->ip->ip_hl*4);
+ break;
+ case IPPROTO_UDP:
+ if(length < l2_offset + (int)x->ip->ip_hl*4 + LIBNET_UDP_H)
+ return(0);
+ ok+=LIBNET_UDP_H;
+- (char *)x->udp = (char *)x->ip + ((int)x->ip->ip_hl*4);
++ x->udp = (char *)x->ip + ((int)x->ip->ip_hl*4);
+ break;
+ case IPPROTO_ICMP:
+ if(length < l2_offset + (int)x->ip->ip_hl*4 + 8)
+ return(0);
+ ok+=LIBNET_ICMP_H;
+- (char *)x->icmp= (char *)x->ip + ((int)x->ip->ip_hl*4);
++ x->icmp= (char *)x->ip + ((int)x->ip->ip_hl*4);
+ break;
+ default:
+ return(0);
+@@ -317,7 +317,7 @@
+ char buf[MX_B], buf2[MX_B];
+ struct frame x;
+
+- (char *)x.ip = target;
++ x.ip = target;
+ snprintf(buf, sizeof(buf), "%s", inet_ntoa(x.ip->ip_src));
+ snprintf(buf2, sizeof(buf2), "%s", inet_ntoa(x.ip->ip_dst));
+ fprintf(stderr, " IP: i=%s->%s v=%hu hl=%hu s=%hu id=%i o=%hu ttl=%hu pay=%u\n",
+@@ -334,7 +334,7 @@
+ char tmp = '\n';
+
+ if(!short_tcp)tmp=' ';
+- (char *)x.tcp = target;
++ x.tcp = target;
+ fprintf(stderr, "TCP: p=%u->%u, s/a=%u%c",
+ ntohs(x.tcp->th_sport), ntohs(x.tcp->th_dport), ntohl(x.tcp->th_seq),tmp);
+ if(!short_tcp) fprintf(stderr, "-> %u o=%hu f=%hu w=%u u=%u optl=%i\n",
+diff --exclude='*~' -Naur src.orig/scanutil.c src/scanutil.c
+--- src.orig/scanutil.c 2006-07-26 14:28:50.000000000 -0700
++++ src/scanutil.c 2006-07-26 14:37:34.000000000 -0700
+@@ -10,8 +10,8 @@
+ u_char syncookie[20];
+ long synbits;
+
+- (char *)ip = (char *)ipp;
+- (char *)tcp = (char *)ip + (int)ip->ip_hl*4;
++ ip = (char *)ipp;
++ tcp = (char *)ip + (int)ip->ip_hl*4;
+
+
+ bzero(buf, sizeof(buf));
+@@ -39,8 +39,8 @@
+ u_char syncookie[20];
+ long synbits;
+
+- (char *)ip = (char *)ipp;
+- (char *)tcp = (char *)ip + (int)ip->ip_hl*4;
++ ip = (char *)ipp;
++ tcp = (char *)ip + (int)ip->ip_hl*4;
+
+ bzero(buf, sizeof(buf));
+ memcpy(buf, &ip->ip_dst, 4);
+@@ -261,7 +261,7 @@
+ 0, /*how much crap*/
+ (char *)x->eth);
+
+- (char *)x->ip = (char *)x->eth + LIBNET_ETH_H;
++ x->ip = (char *)x->eth + LIBNET_ETH_H;
+
+ libnet_build_ip(LIBNET_TCP_H,
+ 0, // tos
+@@ -276,7 +276,7 @@
+ (char *)x->ip);
+
+ x->ip->ip_off = 64; /* set DF flag */
+- (char *)x->tcp = (char *)x->ip + (int)x->ip->ip_hl*4;
++ x->tcp = (char *)x->ip + (int)x->ip->ip_hl*4;
+
+ libnet_build_tcp(12345, // source port
+ 139, // dest port