openbsd-ports/security/antisniff/patches/patch-etherping_c
jsyn c12e61ab46 - rename patches
- douse with $OpenBSD$
- fix DESCR
- regen PLIST
2002-03-24 08:36:33 +00:00

22 lines
678 B
Plaintext

$OpenBSD: patch-etherping_c,v 1.1 2002/03/24 08:36:33 jsyn Exp $
--- etherping.c.orig Sat Dec 12 15:40:06 1998
+++ etherping.c Thu Oct 28 19:15:03 1999
@@ -48,6 +48,7 @@
struct ether_addr e_src;
struct in_addr iaddr;
char promiscGuy[MAX_LEN];
+ static char *dev = NULL;
fromlen = sizeof(from);
@@ -92,7 +93,8 @@
#else
snprintf(ether_src, sizeof(ether_src), "%s", ether_ntoa(&e_src));
#endif
- getipaddr(DEVICENAME, &iaddr);
+ if (!dev) dev = strdup(pcap_lookupdev(NULL));
+ getipaddr(dev, &iaddr);
icmp_pack = (char *)make_icmp_echo(ether_addr, ether_src, target_ip, inet_ntoa(iaddr), ident, &len);
/* send_raw_frame(fd, icmp_pack, len, 0); */