updated on Sun Jan 15 20:01:04 UTC 2012
[aur-mirror.git] / paketto / paketto.patch
blob8ec1042a85979ff6fe216dc8c6b6994a89d87d15
1 diff -r -U 3 a/src/config.h b/src/config.h
2 --- a/src/config.h 2002-12-24 21:40:35.000000000 +0530
3 +++ b/src/config.h 2007-06-23 17:03:10.000000000 +0530
4 @@ -11,7 +11,7 @@
5 #define HAVE_MEMORY_H 1
7 /* Define to 1 if you have the <stdint.h> header file. */
8 -/* #undef HAVE_STDINT_H */
9 +#define HAVE_STDINT_H 1
11 /* Define to 1 if you have the <stdlib.h> header file. */
12 #define HAVE_STDLIB_H 1
13 @@ -23,7 +23,7 @@
14 #define HAVE_STRING_H 1
16 /* Define to 1 if you have the <sys/ioccom.h> header file. */
17 -#define HAVE_SYS_IOCCOM_H 1
18 +/* #undef HAVE_SYS_IOCCOM_H */
20 /* Define to 1 if you have the <sys/stat.h> header file. */
21 #define HAVE_SYS_STAT_H 1
22 diff -r -U 3 a/src/lc.c b/src/lc.c
23 --- a/src/lc.c 2002-12-24 20:39:00.000000000 +0530
24 +++ b/src/lc.c 2007-06-23 17:03:10.000000000 +0530
25 @@ -190,8 +190,8 @@
26 break;
27 case 'h':
28 if(sniff_file[0]=='-' &&
29 - sniff_file[1]==0) (void *)sniff.dump = stdout;
30 - else sniff.dump = (void *)fopen(sniff_file, "w");
31 + sniff_file[1]==0) sniff.dump = stdout;
32 + else sniff.dump = (void*)fopen(sniff_file, "w");
33 if(!sniff.dump){
34 fprintf(stderr, "Couldn't open file: %s\n", sniff.dump);
35 lc_usage();
36 @@ -223,7 +223,7 @@
37 break;
38 case 'h':
39 if(spoof_file[0]=='-' &&
40 - spoof_file[1]==0) (void *)spoof.pcap = stdin;
41 + spoof_file[1]==0) spoof.pcap = stdin;
42 else spoof.pcap = (void *)fopen(spoof_file, "r");
43 if(!spoof.pcap){
44 fprintf(stderr, "Couldn't open file: %s\n", spoof.pcap);
45 @@ -244,7 +244,7 @@
46 i=1;
47 if(!pid){
48 if(sniff_packets){
49 - (void *)sniff.packet = pcap_next(sniff.pcap, &(sniff.pkthdr));
50 + sniff.packet = pcap_next(sniff.pcap, &(sniff.pkthdr));
51 if(!sniff.packet) continue; /* network has "infinite packets, but there's blocking */
52 if(trailer_sniff){
53 pk_hmac(buf, sniff_key, sniff.packet, sniff.pkthdr.caplen-21);
54 diff -r -U 3 a/src/minewt.c b/src/minewt.c
55 --- a/src/minewt.c 2002-12-24 20:39:00.000000000 +0530
56 +++ b/src/minewt.c 2007-06-23 17:03:38.000000000 +0530
57 @@ -185,9 +185,6 @@
58 perror("pcap_open_live");
59 exit(EXIT_FAILURE);
61 - if (ioctl(pcap_fileno(internal_pcap), BIOCIMMEDIATE, &immediate)) {
62 - /*perror("Couldn't set BPF to Immediate Mode.");*/
63 - }
65 if(!strncmp(internal_dev, external_dev, sizeof(internal_dev)))
67 @@ -240,9 +237,6 @@
68 perror("pcap_open_live");
69 exit(EXIT_FAILURE);
71 - if (ioctl(pcap_fileno(external_pcap), BIOCIMMEDIATE, &immediate)) {
72 - //perror("Couldn't set BPF to Immediate Mode.");
73 - }
74 /* Compile and set the filter program */
75 if (pcap_compile(external_pcap, &external_fp, external_pfprogram, 1, 0x0) == -1) {
76 pcap_perror(external_pcap, "pcap_compile");
77 @@ -599,7 +593,7 @@
78 /* XXX very probable security hole lives here -- we must validate length, at minimum*/
79 if(stateless_ipt &&
80 (x.ip->ip_hl*4) != LIBNET_IP_H){
81 - (char *)packet_state = (char *)x.ip + LIBNET_IP_H + 4;
82 + packet_state = (char *)x.ip + LIBNET_IP_H + 4;
85 if(packet_state || (packet_state = find_entry(packet_key)))
86 diff -r -U 3 a/src/paketto.c b/src/paketto.c
87 --- a/src/paketto.c 2002-12-23 18:04:35.000000000 +0530
88 +++ b/src/paketto.c 2007-06-23 17:03:10.000000000 +0530
89 @@ -109,7 +109,7 @@
90 if(datalink != DLT_EN10MB) return(0); /* validate is our ethernet */
91 if(length < LIBNET_ETH_H) return(0); /* validate can be ethernet */
93 - (char *)x->eth = (char *)packet;
94 + x->eth = (struct libnet_ethernet_hdr *)packet;
95 l2_offset=LIBNET_ETH_H;
96 ok += l2_offset;
98 @@ -118,7 +118,7 @@
99 case ETHERTYPE_ARP:
100 if(length < LIBNET_ETH_H + LIBNET_ARP_H)
101 return(0);
102 - (char *)x->arp = (char *)x->eth + LIBNET_ETH_H;
103 + x->arp = (struct libnet_arp_hdr *)(x->eth + LIBNET_ETH_H);
104 ok+=LIBNET_ARP_H;
105 return(ok);
106 break;
107 @@ -133,8 +133,8 @@
108 if(length < l2_offset + LIBNET_IP_H) /* Could we be IP? */
109 return(0);
110 ok+=LIBNET_IP_H;
111 - if(x->eth) (char *)x->ip = (char *)x->eth + l2_offset;
112 - else (char *)x->ip = (char *)packet;
113 + if(x->eth) x->ip = (char*)x->eth + l2_offset;
114 + else x->ip = (char *)packet;
116 if(x->ip->ip_off != 0 && x->ip->ip_off != ntohs(16384)) return(0);
117 if(x->ip->ip_v != 4) return(0);
118 @@ -164,19 +164,19 @@
119 return(0);
120 ok+=LIBNET_TCP_H;
122 - (char *)x->tcp = (char *)x->ip + ((int)x->ip->ip_hl*4);
123 + x->tcp = (char *)x->ip + ((int)x->ip->ip_hl*4);
124 break;
125 case IPPROTO_UDP:
126 if(length < l2_offset + (int)x->ip->ip_hl*4 + LIBNET_UDP_H)
127 return(0);
128 ok+=LIBNET_UDP_H;
129 - (char *)x->udp = (char *)x->ip + ((int)x->ip->ip_hl*4);
130 + x->udp = (char *)x->ip + ((int)x->ip->ip_hl*4);
131 break;
132 case IPPROTO_ICMP:
133 if(length < l2_offset + (int)x->ip->ip_hl*4 + 8)
134 return(0);
135 ok+=LIBNET_ICMP_H;
136 - (char *)x->icmp= (char *)x->ip + ((int)x->ip->ip_hl*4);
137 + x->icmp= (char *)x->ip + ((int)x->ip->ip_hl*4);
138 break;
139 default:
140 return(0);
141 @@ -317,7 +317,7 @@
142 char buf[MX_B], buf2[MX_B];
143 struct frame x;
145 - (char *)x.ip = target;
146 + x.ip = target;
147 snprintf(buf, sizeof(buf), "%s", inet_ntoa(x.ip->ip_src));
148 snprintf(buf2, sizeof(buf2), "%s", inet_ntoa(x.ip->ip_dst));
149 fprintf(stderr, " IP: i=%s->%s v=%hu hl=%hu s=%hu id=%i o=%hu ttl=%hu pay=%u\n",
150 @@ -334,7 +334,7 @@
151 char tmp = '\n';
153 if(!short_tcp)tmp=' ';
154 - (char *)x.tcp = target;
155 + x.tcp = target;
156 fprintf(stderr, "TCP: p=%u->%u, s/a=%u%c",
157 ntohs(x.tcp->th_sport), ntohs(x.tcp->th_dport), ntohl(x.tcp->th_seq),tmp);
158 if(!short_tcp) fprintf(stderr, "-> %u o=%hu f=%hu w=%u u=%u optl=%i\n",
159 diff -r -U 3 a/src/paketto.h b/src/paketto.h
160 --- a/src/paketto.h 2002-12-23 11:12:22.000000000 +0530
161 +++ b/src/paketto.h 2007-06-23 17:03:10.000000000 +0530
162 @@ -17,10 +17,7 @@
163 #include <sys/ioccom.h>
164 #endif
165 #ifndef _IOW
166 -#error "We couldn't find the system macro _IOW on your machine...if you run
167 -find /usr/include | xargs grep _IOW
168 -and find some file other than sys/sockio.h containing the macro, email
169 -dan@doxpara.com and I'll get it in the next build."
170 +#error "We couldn't find the system macro _IOW on your machine...if you run find /usr/include | xargs grep _IOW and find some file other than sys/sockio.h containing the macro, email dan@doxpara.com and I'll get it in the next build."
171 #endif
173 #include <sys/types.h>
174 diff -r -U 3 a/src/scanutil.c b/src/scanutil.c
175 --- a/src/scanutil.c 2002-12-24 21:16:10.000000000 +0530
176 +++ b/src/scanutil.c 2007-06-23 17:03:10.000000000 +0530
177 @@ -10,8 +10,8 @@
178 u_char syncookie[20];
179 long synbits;
181 - (char *)ip = (char *)ipp;
182 - (char *)tcp = (char *)ip + (int)ip->ip_hl*4;
183 + ip = (char *)ipp;
184 + tcp = (char *)ip + (int)ip->ip_hl*4;
187 bzero(buf, sizeof(buf));
188 @@ -39,8 +39,8 @@
189 u_char syncookie[20];
190 long synbits;
192 - (char *)ip = (char *)ipp;
193 - (char *)tcp = (char *)ip + (int)ip->ip_hl*4;
194 + ip = (char *)ipp;
195 + tcp = (char *)ip + (int)ip->ip_hl*4;
197 bzero(buf, sizeof(buf));
198 memcpy(buf, &ip->ip_dst, 4);
199 @@ -261,7 +261,7 @@
200 0, /*how much crap*/
201 (char *)x->eth);
203 - (char *)x->ip = (char *)x->eth + LIBNET_ETH_H;
204 + x->ip = (char *)x->eth + LIBNET_ETH_H;
206 libnet_build_ip(LIBNET_TCP_H,
207 0, // tos
208 @@ -276,7 +276,7 @@
209 (char *)x->ip);
211 x->ip->ip_off = 64; /* set DF flag */
212 - (char *)x->tcp = (char *)x->ip + (int)x->ip->ip_hl*4;
213 + x->tcp = (char *)x->ip + (int)x->ip->ip_hl*4;
215 libnet_build_tcp(12345, // source port
216 139, // dest port