diff --git a/scapy/arch/__init__.py b/scapy/arch/__init__.py index 23e1cb7ce655df563bbe01bbfe596d850d942d9c..7d231148656514d22b9fb188cb90e693873242f5 100644 --- a/scapy/arch/__init__.py +++ b/scapy/arch/__init__.py @@ -52,6 +52,7 @@ SOLARIS=sys.platform.startswith("sunos") WINDOWS=sys.platform.startswith("win32") X86_64 = not WINDOWS and (os.uname()[4] == 'x86_64') +ARM_64 = not WINDOWS and (os.uname()[4] == 'aarch64') # Next step is to import following architecture specific functions: diff --git a/scapy/arch/linux.py b/scapy/arch/linux.py index 40fcffd3660dc1793a75464dae23b014c03a25e8..222cd0119139cef482bdaf09cf3f8f7e75ac6737 100644 --- a/scapy/arch/linux.py +++ b/scapy/arch/linux.py @@ -132,7 +132,7 @@ def attach_filter(s, filter): # XXX. Argl! We need to give the kernel a pointer on the BPF, # python object header seems to be 20 bytes. 36 bytes for x86 64bits arch. - if scapy.arch.X86_64: + if scapy.arch.X86_64 or scapy.arch.ARM_64: bpfh = struct.pack("HL", nb, id(bpf)+36) else: bpfh = struct.pack("HI", nb, id(bpf)+20) @@ -282,7 +282,7 @@ def get_if(iff,cmd): def get_if_index(iff): return int(struct.unpack("I",get_if(iff, SIOCGIFINDEX)[16:20])[0]) -if os.uname()[4] == 'x86_64': +if os.uname()[4] in [ 'x86_64', 'aarch64' ]: def get_last_packet_timestamp(sock): ts = ioctl(sock, SIOCGSTAMP, "1234567890123456") s,us = struct.unpack("QQ",ts)