update dsniff to 2.4b1 and fix some compile issues
[openwrt/svn-archive/archive.git] / openwrt / package / dsniff / patches / arpspoof-fix.patch
1 diff -urN dsniff.old/arp.c dsniff.dev/arp.c
2 --- dsniff.old/arp.c 2001-03-15 09:32:58.000000000 +0100
3 +++ dsniff.dev/arp.c 2006-03-03 01:41:10.000000000 +0100
4 @@ -39,7 +39,7 @@
5
6 #ifdef BSD
7 int
8 -arp_cache_lookup(in_addr_t ip, struct ether_addr *ether)
9 +arp_cache_lookup(in_addr_t ip, struct ether_addr *ether, const char *lif)
10 {
11 int mib[6];
12 size_t len;
13 @@ -91,7 +91,7 @@
14 #endif
15
16 int
17 -arp_cache_lookup(in_addr_t ip, struct ether_addr *ether)
18 +arp_cache_lookup(in_addr_t ip, struct ether_addr *ether, const char *lif)
19 {
20 int sock;
21 struct arpreq ar;
22 @@ -99,7 +99,7 @@
23
24 memset((char *)&ar, 0, sizeof(ar));
25 #ifdef __linux__
26 - strncpy(ar.arp_dev, "eth0", sizeof(ar.arp_dev)); /* XXX - *sigh* */
27 + strncpy(ar.arp_dev, lif, strlen(lif));
28 #endif
29 sin = (struct sockaddr_in *)&ar.arp_pa;
30 sin->sin_family = AF_INET;
31 diff -urN dsniff.old/arp.h dsniff.dev/arp.h
32 --- dsniff.old/arp.h 2001-03-15 09:27:08.000000000 +0100
33 +++ dsniff.dev/arp.h 2006-03-03 01:42:23.000000000 +0100
34 @@ -11,6 +11,6 @@
35 #ifndef _ARP_H_
36 #define _ARP_H_
37
38 -int arp_cache_lookup(in_addr_t ip, struct ether_addr *ether);
39 +int arp_cache_lookup(in_addr_t ip, struct ether_addr *ether, const char *lif);
40
41 #endif /* _ARP_H_ */
42 diff -urN dsniff.old/arpspoof.c dsniff.dev/arpspoof.c
43 --- dsniff.old/arpspoof.c 2001-03-15 09:32:58.000000000 +0100
44 +++ dsniff.dev/arpspoof.c 2006-03-03 01:42:00.000000000 +0100
45 @@ -113,7 +113,7 @@
46 int i = 0;
47
48 do {
49 - if (arp_cache_lookup(ip, mac) == 0)
50 + if (arp_cache_lookup(ip, mac, intf) == 0)
51 return (1);
52 #ifdef __linux__
53 /* XXX - force the kernel to arp. feh. */