Skip to content
Snippets Groups Projects
Commit 0be3f632 authored by Phil's avatar Phil
Browse files

Fix for get_last_packet_timestamp() on x86_64 (thanks to A. Howell)

parent 03da0376
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,6 @@ SIOCSIFFLAGS = 0x8914 # set flags
SIOCGIFINDEX = 0x8933 # name -> if_index mapping
SIOCGIFCOUNT = 0x8938 # get number of devices
SIOCGSTAMP = 0x8906 # get packet timestamp (as a timeval)
SIOCGSTAMPNS = 0x8907 # get packet timestamp (as a timespec)
# From if.h
IFF_UP = 0x1 # Interface is up.
......@@ -274,7 +273,7 @@ def get_if_index(iff):
if os.uname()[4] == 'x86_64':
def get_last_packet_timestamp(sock):
ts = ioctl(sock, SIOCGSTAMPNS, "1234567890123456")
ts = ioctl(sock, SIOCGSTAMP, "1234567890123456")
s,us = struct.unpack("QQ",ts)
return s+us/1000000.0
else:
......
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