37494079b7
* honor CFLAGS * regen patches
30 lines
1.0 KiB
Plaintext
30 lines
1.0 KiB
Plaintext
$OpenBSD: patch-etherping_c,v 1.2 2005/04/03 19:32:29 naddy Exp $
|
|
--- etherping.c.orig Tue Apr 18 03:52:53 2000
|
|
+++ etherping.c Sun Apr 3 21:24:04 2005
|
|
@@ -13,7 +13,6 @@ int getIPfromPkt(char *pkt, int len, cha
|
|
int isUniqueMachineResult(struct result *, char *);
|
|
int insertMachine(struct result *, char *);
|
|
char *ether_ntoa (struct ether_addr *e);
|
|
-struct ether_addr *ether_aton (char *s);
|
|
|
|
|
|
int etherping_done=0;
|
|
@@ -48,6 +47,7 @@ int etherping(HDEV fd, char *ether_addr,
|
|
struct ether_addr e_src;
|
|
struct in_addr iaddr;
|
|
char promiscGuy[MAX_LEN];
|
|
+ static char *dev = NULL;
|
|
|
|
fromlen = sizeof(from);
|
|
|
|
@@ -92,7 +92,8 @@ int etherping(HDEV fd, char *ether_addr,
|
|
#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); */
|
|
|