Skip to content

Commit

Permalink
Fix remote PCAP detection logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kayoub5 committed Mar 2, 2025
1 parent 4e9464d commit 46a1f33
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion SharpPcap/LibPcap/LibPcapLiveDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,11 @@ public override void Open(DeviceConfiguration configuration)
immediateMode = true;
}

var remote_pcap = pcapInterface.Name.StartsWith("rpcap://")
|| pcapInterface.Name.StartsWith("rpcaps://")
|| credentials != null;
// Some configurations can only be used with pcap_create
var use_pcap_create = credentials == null && (short)otherModes == 0;
var use_pcap_create = !remote_pcap && (short)otherModes == 0;
if (use_pcap_create)
{
Handle = LibPcapSafeNativeMethods.pcap_create(
Expand Down

0 comments on commit 46a1f33

Please sign in to comment.