diff -u wackamole-2.1.4/defines.h wackamole-2.1.4-forpatchset/defines.h --- wackamole-2.1.4/defines.h 2005-03-30 20:56:58.000000000 +0100 +++ wackamole-2.1.4-forpatchset/defines.h 2009-03-29 20:57:11.000000000 +0100 @@ -382,6 +382,7 @@ struct in_addr netmask; struct in_addr network; unsigned char mac[ETH_ALEN]; + int left_todo[MAX_NOTIF]; }; #define _if_ip(a) ((a).ipaddr) @@ -415,7 +416,6 @@ struct { int ifcount; struct interface lVIF[MAX_PSEUDO+1]; - int left_todo[MAX_NOTIF]; arp_entry *arpcache; } arp_spoof_data; diff -u wackamole-2.1.4/ife-bpf.c wackamole-2.1.4-forpatchset/ife-bpf.c --- wackamole-2.1.4/ife-bpf.c 2005-11-18 18:50:01.000000000 +0000 +++ wackamole-2.1.4-forpatchset/ife-bpf.c 2009-04-01 14:29:58.000000000 +0100 @@ -58,6 +58,7 @@ static unsigned char my_mac[ETH_ALEN]; static unsigned char bc_mac[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; + memset(&ifr, sizeof(struct ifreq), 0); strncpy(ifr.ifr_name, dev, IFNAMSIZ); if (ioctl(_if_bpf, BIOCSETIF, (caddr_t)&ifr) < 0) { diff -u wackamole-2.1.4/ife-win32.c wackamole-2.1.4-forpatchset/ife-win32.c --- wackamole-2.1.4/ife-win32.c 2005-03-30 20:56:58.000000000 +0100 +++ wackamole-2.1.4-forpatchset/ife-win32.c 2009-04-01 14:33:06.000000000 +0100 @@ -111,7 +111,6 @@ } } else { - fprintf(stderr, "Call to GetAdaptersInfo failed.\n"); if_last_error = dwRetVal; } @@ -216,7 +215,7 @@ int retval = -1; unsigned char my_mac[ETH_ALEN]; struct get_my_mac get_mac; - + if (-1 == pcap_findalldevs_ex("rpcap://", NULL, &alldevs, errbuf)) { fprintf(stderr, "Failed to enum devices: %s\n", errbuf); return -1; diff -u wackamole-2.1.4/spoofmanager.c wackamole-2.1.4-forpatchset/spoofmanager.c --- wackamole-2.1.4/spoofmanager.c 2004-07-28 21:56:53.000000000 +0100 +++ wackamole-2.1.4-forpatchset/spoofmanager.c 2009-04-01 14:34:10.000000000 +0100 @@ -106,13 +106,11 @@ * if event driven, we do our work and reschedule ourselved for subsequent * passes. */ void arp_spoof_notifier( int code, void *data ) { - int i, j, old; + int i, j, ni,old; entry *VE = (entry *)data; #ifdef DONT_USE_THREADS sp_time sleep_time = { 1, 0 }; /* 1 second. */ - #else - pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &old); #endif if( !code ) { @@ -120,17 +118,18 @@ if(_pif_ip_s(*VE)) { memcpy(&(VE->arp_spoof_data.lVIF[VE->arp_spoof_data.ifcount]), &(VE->pseudo_if), sizeof(struct interface) ); + for(ni=0;niarp_spoof_data.lVIF[VE->arp_spoof_data.ifcount].left_todo[ni]=-1; VE->arp_spoof_data.ifcount++; } for(i=0;(iarp_spoof_data.lVIF[VE->arp_spoof_data.ifcount]), &(VE->extra_ifs[i]), sizeof(struct interface) ); + for(ni=0;niarp_spoof_data.lVIF[VE->arp_spoof_data.ifcount].left_todo[ni]=-1; VE->arp_spoof_data.ifcount++; } - for(i=0;iarp_spoof_data.left_todo[i]=-1; - } + } #ifndef DONT_USE_THREADS do { #endif @@ -142,10 +141,11 @@ /* fetch arp cache and do that */ old+=send_arp_spoof_arp_cache( &(VE->arp_spoof_data.lVIF[j]), ni, VE->arp_spoof_data.arpcache, - &(VE->arp_spoof_data.left_todo[i]) ); + &(VE->arp_spoof_data.lVIF[j].left_todo[i]) ); } else { + wack_alarm(ARPING,"notifying for %s\n",inet_ntoa(VE->arp_spoof_data.lVIF[j].ipaddr)); old+=send_arp_spoof_netblock( &(VE->arp_spoof_data.lVIF[j]), ni, - &(VE->arp_spoof_data.left_todo[i]) ); + &(VE->arp_spoof_data.lVIF[j].left_todo[i]) ); } } } @@ -237,8 +237,10 @@ struct interface newcidr; int csize, c, s; +wack_alarm(ARPING, "Spoofing (netblockstart): destination:%s:%s, count:%d", n->destination.ifname,inet_ntoa(n->destination.ipaddr),*count); if(*count == 0) return 0; csize = calc_new_cidr(i, &(n->destination), &newcidr); + wack_alarm(ARPING, "Spoofing (cmpifname): i->ifname:%s n->destination.ifname:%s\n",i->ifname, n->destination.ifname); if(strcmp(i->ifname, n->destination.ifname)) { return 0; } @@ -247,6 +249,7 @@ _if_ip_s(newcidr) = htonl(ntohl(_if_ip_s(newcidr))+(csize-*count)); for(s=0,c=(csize-*count);(cthrottle || (sthrottle));c++) { wack_alarm(ARPING, "Spoofing (static): %s:%s", i->ifname, inet_ntoa(newcidr.ipaddr)); +wack_alarm(ARPING, "Spoofing (static): %s:%s:%s", inet_ntoa(newcidr.ipaddr),inet_ntoa(i->ipaddr),n->ping); if_send_spoof_request(i->ifname, _if_ip_s(*i), _if_ip_s(newcidr), NULL, 2, n->ping); Common subdirectories: wackamole-2.1.4/t and wackamole-2.1.4-forpatchset/t diff -u wackamole-2.1.4/wackamole.c wackamole-2.1.4-forpatchset/wackamole.c --- wackamole-2.1.4/wackamole.c 2007-02-06 14:34:46.000000000 +0000 +++ wackamole-2.1.4-forpatchset/wackamole.c 2009-03-26 22:42:17.000000000 +0000 @@ -199,7 +199,10 @@ Usage( argc, argv ); Wackamole_init(); - if(Debug) wack_alarm_set( PRINT | ARPING | WACK_DEBUG | EXIT ); + if(Debug) { + wack_alarm_enable_timestamp(NULL); + wack_alarm_set( PRINT | ARPING | WACK_DEBUG | EXIT ); + } else { char pidstring[10];