Re: [tcpdump-workers] Compatibility Libpcap/Winpcap and timout of

2009-01-28 Thread Guy Harris
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)

Re: [tcpdump-workers] Compatibility Libpcap/Winpcap and timout of

2009-01-28 Thread Benoit
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