You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Sending packets with pcap_sendqueue_transmit lead to that on receive these packets with pcap_dispatch the packets are duplicated (default case) or not received at all. The result depends on set value by PacketSetLoopbackBehavior. The issue starts at commit a25b79cEmulate WinPcap behavior regarding looped-back packets.
In case the test is too big, shorten the test just to TestTransmitQueueToLive(10, 60, 0.5, false);.
In case you open wireshark on the adapter, you will see also duplicate packets.
Probably does the unit test of original Pcap.Net also work, but this project is plain C#, the original not.
Expected behavior
loopback Packets are only received once.
Diagnostic information
Windows version from winver Windows 11 Version 22H2, OS Build 22621.2715
Other infos
Just the adding of SendFlags |= NDIS_SEND_FLAGS_CHECK_FOR_LOOPBACK; from a25b79c lead to this error.
Wireshark on this PC receives the packet also twice, but checking the other end of the cable via wireshark shows just unique packets.
On a fresh installed Virtual machine Win 10 22H2 / Win 11 22H2 build 22621.1702 / Win 11 22H2 build 22621.4112/ Win11 23H2 the test passes.
After test on multiple PCs with difference network adapter from different vendors, I can say it happens only on intel network drivers, realtek is not affected.
The text was updated successfully, but these errors were encountered:
A solution for my use case would be to remove in NPF_BufferedWrite the SendFlags |= NDIS_SEND_FLAGS_CHECK_FOR_LOOPBACK;, To test the NPF_Write I used the test BerkeleyPacketFilterTests.NoCommunicatorConstructorTest, the result is the same, remove the SendFlags |= NDIS_SEND_FLAGS_CHECK_FOR_LOOPBACK; . I tested this change in my HyperV virtual machine, where this bug does not appear and wireshark shows the correct packet count.
trivalik
changed the title
Unit test fails since version 0.999
Unit test fails since version 0.999 or intel driver duplicate packets
Sep 3, 2024
trivalik
changed the title
Unit test fails since version 0.999 or intel driver duplicate packets
Unit test fails since version 0.999 or windows intel driver duplicates packets
Sep 3, 2024
Describe the bug
Sending packets with
pcap_sendqueue_transmit
lead to that on receive these packets withpcap_dispatch
the packets are duplicated (default case) or not received at all. The result depends on set value byPacketSetLoopbackBehavior
. The issue starts at commit a25b79cEmulate WinPcap behavior regarding looped-back packets
.To Reproduce
Running unit test of
https://github.com/klaus0x7c4/Pcap.Net/blob/8b61736a4483a08cf88fd66c7e24826e5610bdd0/PcapDotNet/src/PcapDotNet.Core.Test/PacketSendBufferTests.cs#L19
In case the test is too big, shorten the test just to
TestTransmitQueueToLive(10, 60, 0.5, false);
.In case you open wireshark on the adapter, you will see also duplicate packets.
Probably does the unit test of original Pcap.Net also work, but this project is plain C#, the original not.
Expected behavior
loopback Packets are only received once.
Diagnostic information
Windows version from
winver
Windows 11 Version 22H2, OS Build 22621.2715Other infos
Just the adding of
SendFlags |= NDIS_SEND_FLAGS_CHECK_FOR_LOOPBACK;
from a25b79c lead to this error.Wireshark on this PC receives the packet also twice, but checking the other end of the cable via wireshark shows just unique packets.
On a fresh installed Virtual machine Win 10 22H2 / Win 11 22H2 build 22621.1702 / Win 11 22H2 build 22621.4112/ Win11 23H2 the test passes.
After test on multiple PCs with difference network adapter from different vendors, I can say it happens only on intel network drivers, realtek is not affected.
The text was updated successfully, but these errors were encountered: