When capturing traffic on the Windows using PcapPlusPlus, each localhost packet appears twice: once on the send path (outbound) and once on the receive path (inbound).
Wireshark shows only one copy, but with PcapPlusPlus I see duplicates sometimes.
However, strangely, sometimes the same code shows only one copy.
So behavior is inconsistent: sometimes duplicates, sometimes single packet.
Steps to reproduce the behavior:
1. Install Npcap (latest version)
2. Run a simple program using PcapLiveDevice to capture on `\Device\NPF_Loopback`
3. Send UDP/TCP traffic to 127.0.0.1 between two local ports
4. Observe that `onPacketArrives` is triggered twice for each logical packet
Ideally, when capturing on loopback, PcapPlusPlus should behave like Wireshark:
- Show only one copy of the packet (either inbound or outbound)
- Or provide a flag/option to suppress duplicate packets
Additionally, from my debug logs I can confirm that the **same packet arrives twice**.
Both copies have the same src/dst IP and ports, same length, and same payload,
but their **timestamps are slightly different**.
The timestamp value is taken from the function provided by the PcapPlusPlus library itself.
Environment:
- OS: Windows 11
- Npcap version: 1.79 (loopback adapter installed)
- PcapPlusPlus version: 25.05 (built with MinGW)
- Compiler: MinGW-w64 GCC 15.1.0