openbsd-ports/security/antisniff/patches/patch-ip_util_c
2005-04-03 19:32:29 +00:00

24 lines
810 B
Plaintext

$OpenBSD: patch-ip_util_c,v 1.2 2005/04/03 19:32:29 naddy Exp $
--- ip_util.c.orig Wed Oct 1 21:51:42 1997
+++ ip_util.c Sun Apr 3 21:23:31 2005
@@ -3,7 +3,6 @@
int getnetmask(char *dev, struct in_addr *iaddr);
int getipaddr(char *dev, struct in_addr *iaddr);
-struct ether_addr *ether_aton (char *s);
int getIPfromPkt(char *pkt, int len, char *holder){
@@ -35,8 +34,9 @@ int validTarget(char *target_address){
devname = getenv(ANTI_INTERFACE);
if (!devname){
- getnetmask(DEVICENAME, (struct in_addr *)&network);
- getipaddr(DEVICENAME, (struct in_addr *)&localIP);
+ devname = strdup(pcap_lookupdev(NULL));
+ getnetmask(devname, (struct in_addr *)&network);
+ getipaddr(devname, (struct in_addr *)&localIP);
} else {
devPtr = strrchr(devname, '/');
if (devPtr)