This may belong in another forum but since I am encountering this in a BASH script I will start here.
I am examining records created using the
The implication of this is that the value of last_seen must be divided by 1000 to give the epoch seconds. However, doing so results in nonsensical date values. For example:
Now, if I calculate the divisor by dividing the last_seen value by the current system time in seconds (using a last_seen value added to the target file immediately before calculating) then I get a value of ~ 32.76900613131959085090. This gives more reasonable results but the calculated value is not consistent across trials. For example:
My question is: Why do the entries in different tables, or even consecutive entries in the same table, not produce the same jiffle factor? What does IPTables use to determine what the jiffle value is?
I am examining records created using the
IPTable
s recent module. The last_seen value is recorded in something that I have read are called jiffles. A jiffle is reported to be 1 sec divided by the HZ rate of the host. In examples I have seen this value is taken from the CONFIG_HZ
in /boot/config-$(uname -r)
. On my FreeBSD-12.2 host this value is 1000.The implication of this is that the value of last_seen must be divided by 1000 to give the epoch seconds. However, doing so results in nonsensical date values. For example:
Code:
last_seen value: 53370951241
Now: 1628705691 seconds
Current Date: Wed Aug 11 14:14:51 EDT 2021
Jiffle: 1000
Calculated EPOCH: 53370951.24100000000000000000
Last Seen Date: Fri Sep 10 13:15:51 EDT 1971
Now, if I calculate the divisor by dividing the last_seen value by the current system time in seconds (using a last_seen value added to the target file immediately before calculating) then I get a value of ~ 32.76900613131959085090. This gives more reasonable results but the calculated value is not consistent across trials. For example:
Code:
last_seen value: 53374644261
Now: 1628709382 seconds
Current Date: Wed Aug 11 15:16:22 EDT 2021
Jiffle Fixed: 32.76900613131959085090
EPOCH from Fixed: 1628814863.87181529108599863390
Last Seen Date: Thu Aug 12 20:34:23 EDT 2021
Jiffle Calculated: 32.77112838599710356429
EPOCH Calculated: 1628709382.00000000000046494679
Last Seen Date: Wed Aug 11 15:16:22 EDT 2021
last_seen value: 53374644261
Now: 1628709386 seconds
Current Date: Wed Aug 11 15:16:26 EDT 2021
Jiffle Fixed: 32.76900613131959085090
EPOCH from Fixed: 1628814863.87181529108599863390
Last Seen Date: Thu Aug 12 20:34:23 EDT 2021
Jiffle Calculated: 32.77112830551343062008
EPOCH Calculated: 1628709386.00000000000048530306
Last Seen Date: Wed Aug 11 15:16:26 EDT 2021
My question is: Why do the entries in different tables, or even consecutive entries in the same table, not produce the same jiffle factor? What does IPTables use to determine what the jiffle value is?