Skip to content

Commit 46a1f33

Browse files
committed
Fix remote PCAP detection logic
1 parent 4e9464d commit 46a1f33

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: SharpPcap/LibPcap/LibPcapLiveDevice.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,11 @@ public override void Open(DeviceConfiguration configuration)
109109
immediateMode = true;
110110
}
111111

112+
var remote_pcap = pcapInterface.Name.StartsWith("rpcap://")
113+
|| pcapInterface.Name.StartsWith("rpcaps://")
114+
|| credentials != null;
112115
// Some configurations can only be used with pcap_create
113-
var use_pcap_create = credentials == null && (short)otherModes == 0;
116+
var use_pcap_create = !remote_pcap && (short)otherModes == 0;
114117
if (use_pcap_create)
115118
{
116119
Handle = LibPcapSafeNativeMethods.pcap_create(

0 commit comments

Comments
 (0)