I really don't understand the motivation behind the Win32-code
for pcap_compile(). In gencode.c:
int
pcap_compile(pcap_t *p, struct bpf_program *program,
const char *buf, int optimize, bpf_u_int32 mask)
{
int result;
EnterCriticalSection(&g_PcapCompileCriticalSection);
result = pcap_compile_unsafe(p, program, buf, optimize, mask);
LeaveCriticalSection(&g_PcapCompileCriticalSection);
return result;
}
----------
Why doesn't other libpcap functions needs this critical-section protection
too?
And how about the case when DllMain() hasn't been called (because libpcap
is used as a static lib) and someone calls e.g. pcap_compile(). Then this
'g_PcapCompileCriticalSection' struct is left un-initialised and the program
will crash.
Can we maybe sprinkle calls to 'wsockinit()' where needed and let 'wsockinit()'
do it's task only once? I could make the needed patches if we agree on this.
--gv
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers