openbsd-ports/security/antisniff/patches/patch-ab
1999-10-29 00:13:18 +00:00

23 lines
535 B
Plaintext

--- arpreqtest.c.orig Wed Oct 1 15:51:34 1997
+++ arpreqtest.c Thu Oct 28 19:06:15 1999
@@ -20,7 +20,7 @@
unsigned long sourceIP, destIP;
struct result *resPtr;
#if defined(_OpenBSD_)
- char *defaultdevice = "ep1";
+ static char *defaultdevice = NULL;
#else if defined(SOLARIS)
char *defaultdevice = "le0";
#endif
@@ -33,7 +33,9 @@
pid_t our_id;
caddr_t area;
-
+ if (!defaultdevice) {
+ defaultdevice = strdup(pcap_lookupdev(NULL));
+ }
#ifdef SOLARIS
mfd = open("/dev/zero", O_RDWR);
if (mfd < 0){