Skip to content

Commit e724d86

Browse files
authored
Fix remote PCAP detection logic (#564)
1 parent eee8735 commit e724d86

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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)