Skip to content
Snippets Groups Projects
Commit 42b608df authored by Pierre Lalet's avatar Pierre Lalet Committed by Guillaume Valadon
Browse files

Tiny Python 3 fixes (#820)

* Python3: fix set_promisc() with Linux

* Fix debug dissector error message

* Make run_scapy3 executable
parent 08b0fab3
No related branches found
No related tags found
No related merge requests found
run_scapy3 100644 → 100755
File mode changed from 100644 to 100755
...@@ -163,7 +163,7 @@ def attach_filter(s, bpf_filter, iface): ...@@ -163,7 +163,7 @@ def attach_filter(s, bpf_filter, iface):
s.setsockopt(SOL_SOCKET, SO_ATTACH_FILTER, bpfh) s.setsockopt(SOL_SOCKET, SO_ATTACH_FILTER, bpfh)
def set_promisc(s,iff,val=1): def set_promisc(s,iff,val=1):
mreq = struct.pack("IHH8s", get_if_index(iff), PACKET_MR_PROMISC, 0, "") mreq = struct.pack("IHH8s", get_if_index(iff), PACKET_MR_PROMISC, 0, b"")
if val: if val:
cmd = PACKET_ADD_MEMBERSHIP cmd = PACKET_ADD_MEMBERSHIP
else: else:
......
...@@ -701,7 +701,7 @@ class Packet(six.with_metaclass(Packet_metaclass, BasePacket)): ...@@ -701,7 +701,7 @@ class Packet(six.with_metaclass(Packet_metaclass, BasePacket)):
except: except:
if conf.debug_dissector: if conf.debug_dissector:
if isinstance(cls,type) and issubclass(cls,Packet): if isinstance(cls,type) and issubclass(cls,Packet):
log_runtime.error("%s dissector failed" % cls.name) log_runtime.error("%s dissector failed" % cls.__name__)
else: else:
log_runtime.error("%s.guess_payload_class() returned [%s]" % (self.__class__.__name__,repr(cls))) log_runtime.error("%s.guess_payload_class() returned [%s]" % (self.__class__.__name__,repr(cls)))
if cls is not None: if cls is not None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment