04_multiple_intf.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. diff -Nur dsniff-2.4-old/arp.c dsniff-2.4/arp.c
  2. --- dsniff-2.4-old/arp.c 2009-09-15 00:11:17.165203268 +0300
  3. +++ dsniff-2.4/arp.c 2009-09-15 00:11:20.325202568 +0300
  4. @@ -39,7 +39,7 @@
  5. #ifdef BSD
  6. int
  7. -arp_cache_lookup(in_addr_t ip, struct ether_addr *ether)
  8. +arp_cache_lookup(in_addr_t ip, struct ether_addr *ether, const char* linf)
  9. {
  10. int mib[6];
  11. size_t len;
  12. @@ -91,7 +91,7 @@
  13. #endif
  14. int
  15. -arp_cache_lookup(in_addr_t ip, struct ether_addr *ether)
  16. +arp_cache_lookup(in_addr_t ip, struct ether_addr *ether, const char* lif)
  17. {
  18. int sock;
  19. struct arpreq ar;
  20. @@ -99,7 +99,7 @@
  21. memset((char *)&ar, 0, sizeof(ar));
  22. #ifdef __linux__
  23. - strncpy(ar.arp_dev, "eth0", sizeof(ar.arp_dev)); /* XXX - *sigh* */
  24. + strncpy(ar.arp_dev, lif, strlen(lif));
  25. #endif
  26. sin = (struct sockaddr_in *)&ar.arp_pa;
  27. sin->sin_family = AF_INET;
  28. diff -Nur dsniff-2.4-old/arp.h dsniff-2.4/arp.h
  29. --- dsniff-2.4-old/arp.h 2009-09-15 00:11:17.159202783 +0300
  30. +++ dsniff-2.4/arp.h 2009-09-15 00:11:20.325202568 +0300
  31. @@ -11,6 +11,6 @@
  32. #ifndef _ARP_H_
  33. #define _ARP_H_
  34. -int arp_cache_lookup(in_addr_t ip, struct ether_addr *ether);
  35. +int arp_cache_lookup(in_addr_t ip, struct ether_addr *ether, const char* linf);
  36. #endif /* _ARP_H_ */
  37. diff -Nur dsniff-2.4-old/arpspoof.c dsniff-2.4/arpspoof.c
  38. --- dsniff-2.4-old/arpspoof.c 2009-09-15 00:11:17.165203268 +0300
  39. +++ dsniff-2.4/arpspoof.c 2009-09-15 00:11:20.325202568 +0300
  40. @@ -113,7 +113,7 @@
  41. int i = 0;
  42. do {
  43. - if (arp_cache_lookup(ip, mac) == 0)
  44. + if (arp_cache_lookup(ip, mac, intf) == 0)
  45. return (1);
  46. #ifdef __linux__
  47. /* XXX - force the kernel to arp. feh. */