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