OPNsense Forum

Archive => 21.1 Legacy Series => Topic started by: tigersharke on April 18, 2021, 05:08:00 am

Title: SOLVED: traffic graph -- incorrect time used -Firefox at fault
Post by: tigersharke on April 18, 2021, 05:08:00 am
It appears that the traffic graph does not use the OPNsense system clock but perhaps pulls the time from the motherboard by some other method?  I say this because I recently went to the bios of the motherboard to discover it showing the same incorrect time as the traffic graph at that moment, the minutes were correct and even the date, but the clock had to be reset to 10am from 3pm in my bios.  I suspect that the cmos battery is no good, as the traffic graph continues to use an inaccurate time. ntpd works properly or the correct time would not be displayed by the system info widget. I hoped to find any config option to ignore the cmos clock but could not find anything about it while the ntpd/system time is accurate. Attached is a screenshot that illustrates the disparity.
Title: Re: traffic graph -- incorrect time used
Post by: Fright on April 18, 2021, 04:27:18 pm
it uses gettimeofday() syscall imho. so the question is why the hardware clock remains out of sync
what is the
Code: [Select]
sysctl machdep.disable_rtc_setvalue?
Title: Re: traffic graph -- incorrect time used
Post by: tigersharke on April 19, 2021, 06:43:42 pm
Code: [Select]
# sysctl machdep.disable_rtc_set
machdep.disable_rtc_set: 0

My search for cmos clock ignore was within OPNsense so I failed to discover what FreeBSD may provide.  Trying to set that sysctl at 1 and see if this solves.. no luck, though the sysctl now reports as 1, the traffic graph is still not in sync with the other clock. 

Here is the WEIRD thing, I just noticed that the timestamp for the most recent firefox screenshot is also wrong, it has the same time as the traffic graph when taken. dclock on my system (primary box) shows correct and the sysctl is not set to ignore cmos. On both boxes, date "+%Z" reports CDT. 

Are we seeing yet another damned firefox-does-it-by-itself feature causing unintended problems?  I do not see anything in firefox about:config that conclusively relates to clock or time or timezone.
Title: Re: traffic graph -- incorrect time used
Post by: Fright on April 19, 2021, 06:46:25 pm
Quote
Trying to set that sysctl at 1
not necessary. 0 is the correct value
Title: Re: traffic graph -- incorrect time used
Post by: Fright on April 19, 2021, 07:20:37 pm
oh, sorry. I looked at a completely wrong script  :-[

traffic graphs shows client time. not server )
so if the time on the client (browser) differs by 5 hours, then the time on the traffic graphs will differ from the time in the System Information widget
Title: SOLVED - traffic graph -- incorrect time used
Post by: tigersharke on April 19, 2021, 07:22:44 pm
Sorry, my prior post edited while you quickly responded to my initial version. :/

The inaccurate time corresponds to UTC time.


It is indeed <string of explicatives> Firefox causing 100% of the problem.  The about:config setting privacy.resistFingerprinting when enabled forces time to be UTC.
Title: Re: traffic graph -- incorrect time used
Post by: Fright on April 19, 2021, 07:33:42 pm
so we found out that there is no bug)
and I don't know if the behavior needs to be changed. in a sense, it is more logical to show the client time on dynamic charts imho
but it's up to devs
Title: Re: traffic graph -- incorrect time used
Post by: tigersharke on April 19, 2021, 07:41:27 pm
IMHO, since logs could also be inaccurately tagged by a clock being set improperly, using the OPNsense device as the clock reference would allow a check against that if no other view of clock value is used in the gui.  Perhaps a config toggle?
Title: Re: SOLVED: traffic graph -- incorrect time used -Firefox at fault
Post by: Fright on April 19, 2021, 09:02:09 pm
sorry, didn't get the idea