0

pcap in linux is dropping packets, and it appears related to shared memory-mapping as addressed here https://stackoverflow.com/a/11660759/1794758.

However, the links on that answer are down so I can't see how to compile libpcap with shared memory-mapping disabled. I've searched online and looked at the libpcap documentations but can't see how this is done.

Community
  • 1
  • 1
jdwiegman
  • 85
  • 8
  • I still experience packets lost after remove memory map in libpcap 1.8.1. Just wonder if there is any other cause or solution – Yee May 25 '18 at 07:56

1 Answers1

0

There is no configuration parameter that you can set. The only way I found to do this is to actually modify the code before you compile. What you have to do is really simple. Here are the steps:

In the source file pcap-linux.c, go to the activate_mmap method. The return code of that method indicates to the caller when memory mapping has been correctly set up. Just short-circuit the method and return 0 from the top and memory mapping should be turned off.