AlexeyS
Joined: 27 Sep 2009 Posts: 7
|
Posted: Thu Mar 04, 2010 8:08 am Post subject: [PATCH] wrong "uptime" on the router without RTC |
|
|
After time synchronization on a router without RTC, UPTIME value equal to ~40 years.
Patch fixes the problem:
Code: |
--- ./miniupnpd.c.orig 2009-12-22 20:22:13.000000000 +0300
+++ ./miniupnpd.c 2010-03-03 13:22:40.000000000 +0300
@@ -911,6 +911,11 @@
/* main loop */
while(!quitting)
{
+ /* Correct startup_time */
+ if((startup_time<60*60*24) && (time(NULL)>60*60*24))
+ {
+ set_startup_time(GETFLAG(SYSUPTIMEMASK)/*sysuptime*/);
+ }
/* Check if we need to send SSDP NOTIFY messages and do it if
* needed */
if(gettimeofday(&timeofday, 0) < 0)
|
|
|