This patch implements periodic clock checking to look for time warps, if one
is detected, the internal counters are adjusted accordingly.
-Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
+Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/main.c
+++ b/pppd/main.c
-@@ -90,6 +90,7 @@
+@@ -89,6 +89,7 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "pppd.h"
#include "magic.h"
-@@ -228,6 +229,7 @@ static struct subprocess *children;
+@@ -226,6 +227,7 @@ static struct subprocess *children;
/* Prototypes for procedures local to this file. */
static void setup_signals __P((void));
static void create_pidfile __P((int pid));
static void create_linkpidfile __P((int pid));
-@@ -535,6 +537,7 @@ main(argc, argv)
+@@ -525,6 +527,7 @@ main(argc, argv)
info("Starting link");
}
gettimeofday(&start_time, NULL);
script_unsetenv("CONNECT_TIME");
script_unsetenv("BYTES_SENT");
-@@ -1267,6 +1270,36 @@ struct callout {
+@@ -1274,6 +1277,36 @@ struct callout {
static struct callout *callout = NULL; /* Callout list */
static struct timeval timenow; /* Current time */
/*
* timeout - Schedule a timeout.
-@@ -1337,6 +1370,8 @@ calltimeout()
+@@ -1344,6 +1377,8 @@ calltimeout()
{
struct callout *p;
while (callout != NULL) {
p = callout;
-@@ -1364,6 +1399,8 @@ timeleft(tvp)
+@@ -1371,6 +1406,8 @@ timeleft(tvp)
{
if (callout == NULL)
return NULL;