]> git.ipfire.org Git - people/ms/mstpd.git/commitdiff
Fix bug: mstpd goes crazy after date change
authordv1tas <dv1tas@fbe50366-0c72-4402-a84b-5d246361dba7>
Thu, 13 Jun 2013 10:27:18 +0000 (10:27 +0000)
committerdv1tas <dv1tas@fbe50366-0c72-4402-a84b-5d246361dba7>
Thu, 13 Jun 2013 10:27:18 +0000 (10:27 +0000)
Signed-off-by: Jorge Gastón
Signed-off-by: Vitalii Demianets
git-svn-id: svn://svn.code.sf.net/p/mstpd/code/trunk@44 fbe50366-0c72-4402-a84b-5d246361dba7

epoll_loop.c

index e2c34423008cdee98f9c1ba796326e98a41805b9..d5b3b019057011f1ef9e9fdc0b6cc8a9db48f4f4 100644 (file)
@@ -94,6 +94,7 @@ static inline int time_diff(struct timeval *second, struct timeval *first)
 static inline void run_timeouts(void)
 {
     bridge_one_second();
+    gettimeofday(&nexttimeout, NULL);
     ++(nexttimeout.tv_sec);
 }
 
@@ -112,7 +113,7 @@ int epoll_main_loop(void)
         struct timeval tv;
         gettimeofday(&tv, NULL);
         timeout = time_diff(&nexttimeout, &tv);
-        if(timeout < 0)
+        if(timeout < 0 || timeout > 1000)
         {
             run_timeouts();
             timeout = 0;