I have a pcap application that uses a filter (as below). The 15th time I call pcap_compile(), it fails with the error "too many registers needed to evaluate expression". <br>I'm using PCAP v4.0.1 and developer pack
4.0.1.<br><br>Is there a call other than pcap_freecode() I should be using to free the memory allocated in the pcap_compile() command?<br><br>int main()<br>{<br>//...<br> pcap_t *pcapHandle = pcap_open_live( curDev->name, 65536, 1, 1000, errbuf);
<br> airHandle = pcap_get_airpcap_handle( pcapHandle );<br> PAirpcapHandle AirpcapSetDeviceChannel( airHandle, channel );<br> struct bpf_program fcode = { 0 };<br><br> for( int i = 0; i < 15; ++i ) {<br> if( pcap_compile( pcapHandle, &fcode, "wlan[0] = 0x80", //beacon //"wlan[0] = 0xd4", //ack 1, 0xffffff ) < 0 )
<br> {<br> fprintf( stderr, "\n[%d]Filter Error. %s\n", i, pcap_geterr( pcapHandle ) );<br> }<br> pcap_freecode( &fcode );<br> }<br>//...<br> return 0;
<br>}<br><br>>[14]Filter Error. too many registers needed to evaluate expression<br><br>Thanks,<br>Paul<br>