I also register an TCP listening event on event_base( two events: on_accept and on_recv.)then I run the program on host A and send packets from host B, meanwhile I use a tcpdump to capture packets on A Â(tcpdump -i eth0 Âport 8000 )ÂFor comparison, I have two laptops which acts as A, I tried the program (compile and then run) on these two laptops, one with Fedora (fedora release 18) and one with Ubuntu (Ubuntu 14.04.2 LTS)on ubuntu events are invoked in the following orderÂon captureÂpcap_dispatch() returns 0on captureÂpcap_dispatch() returns 0on acceptÂon recvÂit is strange that theÂpcap_dispatch returns 0 twice. My expectation is that the when on_capture event is triggered,Âpcap_dispatch will catch TCP SYN packets before on_accept event is triggered. But I don't know why the on_capture events are invoked twice andÂpcap_dispatch()ÂÂreturns 0.on Fedora, the program works as expected, theÂpcap_dispatch() can capture packets the first time it is invoked before on_accept event.ÂI use ldd to check the libraries of this program on each laptop.Fedora:Â Â Â$ldd relayÂlinux-vdso.so.1 => Â(0x00007fff1d1ad000)libevent-1.4.so.2 => /lib/libevent-1.4.so.2 (0x00007faca467d000)libpcap.so.1 => /lib64/libpcap.so.1 (0x00000035b4a00000)libc.so.6 => /lib64/libc.so.6 (0x00000035b0a00000)libnsl.so.1 => /lib64/libnsl.so.1 (0x00000035cea00000)librt.so.1 => /lib64/librt.so.1 (0x00000035b1a00000)libresolv.so.2 => /lib64/libresolv.so.2 (0x00000035b2e00000)/lib64/ld-linux-x86-64.so.2 (0x00000035b0200000)libpthread.so.0 => /lib64/libpthread.so.0 (0x00000035b1600000)ubuntu:Â Â Â $ ldd relayÂlinux-vdso.so.1 => Â(0x00007ffd08bc5000)libevent-2.0.so.5 => /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5 (0x00007eff35f81000)libpcap.so.0.8 => /usr/lib/x86_64-linux-gnu/libpcap.so.0.8 (0x00007eff35d43000)libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007eff3597e000)libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007eff35760000)/lib64/ld-linux-x86-64.so.2 (0x00007eff361c5000)indeed, both libpcap and libevent versions are different.what are potential problems for my program when it runs on ubuntu? how can fix the unexpected problems on ubuntu?thank you!