On Jan 28, 2009, at 1:48 AM, Benoit wrote:
Okay so I should use something like this:
int ret=0;
Assigning 0 to ret isn't necessary, as you're setting it to the return
value of pcap_select_ms() immediately after assigning 0 to it.
if((ret =pcap_select_ms(ifhard->adhandle,ifhard->timeout)
Okay so I should use something like this:
int ret=0;
if((ret =pcap_select_ms(ifhard->adhandle,ifhard->timeout)<=0)) {
if((ret=pcap_next_ex(ifhard->adhandle, &(ifhard->header), (const
u_char**)(&p_pkt))> 0) {
...
}
}
return ret;
This let me be sure that if no packet are received the pcap_selec