<div dir="ltr">Hello,<div><br></div><div>I have been trying to make a custom software bridge using winpcap. Unfortunately this means sending and receiving packets that arrive on a pair of interfaces which means there needs to be some sort of logic preventing infinitely copying any packet that appears in a cycle. As it is a bridge I can't apply a capture filter to match the source MAC/IP of the interfaces since many (known and uknown) MACs/IPs may need to transit the link pair. After digging through the documentation I came across two possible solutions:</div><div><br></div><div>PCAP_SETDIRECTION(device, PCAP_D_IN) - a directional filter to the capture. Unfortunately this returns -1 as it does not seem to be supported on Windows.</div><div>pcap_open() instead of pcap_open_live() - pcap_open() has flags for the 3rd argument, one of which being PCAP_OPENFLAG_NOCAPTURE_LOCAL which is supposed to prevent capturing packets sent by the driver itself.</div><div><br></div><div><br></div><div>Unfortuntaley when I launch 2 threads, one capturing on the interface and one sending, I still receive the sent packets in the capturing thread. I am using the following to open the interface in both threads: pcap_open(InterfaceName, 65536, PCAP_OPENFLAG_NOCAPTURE_LOCAL, 1000, nullptr, ErrorBuffer)</div><div><br></div><div><br></div><div><br></div><div>Does anyone have any guidance on why pcap_open() might be behaving this way or another way to achieve my goal of not capturing packets libpcap itself put on the interface?</div><div><br></div><div><br></div><div>Thank you,</div><div><br></div><div>Daniel Smith</div></div>