mirror of https://github.com/secdev/scapy.git
Fix scapy used with Winpcap on Windows
This commit is contained in:
parent
faeeef0026
commit
f872f1be2a
|
@ -143,7 +143,7 @@ if conf.use_winpcapy:
|
|||
if pcap_set_rfmon(self.pcap, 1) != 0:
|
||||
warning("Could not set monitor mode")
|
||||
if pcap_activate(self.pcap) != 0:
|
||||
warning("Could not activate the handler")
|
||||
raise OSError("Could not activate the pcap handler")
|
||||
else:
|
||||
self.pcap = pcap_open_live(self.iface, snaplen, promisc, to_ms, self.errbuf)
|
||||
self.header = POINTER(pcap_pkthdr)()
|
||||
|
|
|
@ -855,7 +855,7 @@ def open_pcap(iface, *args, **kargs):
|
|||
iface_pcap_name = pcapname(iface)
|
||||
if not isinstance(iface, NetworkInterface) and iface_pcap_name is not None:
|
||||
iface = IFACES.dev_from_name(iface)
|
||||
if isinstance(iface, NetworkInterface) and iface.ismonitor():
|
||||
if conf.use_npcap and isinstance(iface, NetworkInterface) and iface.ismonitor():
|
||||
kargs["monitor"] = True
|
||||
return _orig_open_pcap(iface_pcap_name, *args, **kargs)
|
||||
pcapdnet.open_pcap = open_pcap
|
||||
|
|
Loading…
Reference in New Issue