<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
  img {
    max-width: 100%;
    height: auto;
  }
  p.details {
    font-style:italic;
    color:#777
  }
  .footer p {
    font-size:small;
    color:#777
  }
  pre.commit-message {
    white-space: pre-wrap;
  }
  .file-stats a {
    text-decoration: none;
  }
  .file-stats .new-file {
    color: #090;
  }
  .file-stats .deleted-file {
    color: #B00;
  }
</style>
<body>
<div class='content'>
<h3>Eric S. Raymond pushed to branch master at <a href="https://gitlab.com/NTPsec/ntpsec">NTPsec / ntpsec</a></h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/804a57f98785806e6393056d249b47b6a0836f60">804a57f9</a></strong>
<div>
<span>by Eric S. Raymond</span>
<i>at 2015-12-04T05:12:37Z</i>
</div>
<pre class='commit-message'>Isolate the ntpd main loop into a mainloop() function.

Also moves timer setup into the beginning of this function, and makes
timer reinitialization in the loopfilter contingent on not being in
replay mode.

Though simple, this change is a major step towards implementing replay mode.</pre>
</li>
</ul>
<h4>2 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
ntpd/ntp_loopfilter.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
ntpd/ntpd.c
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/804a57f98785806e6393056d249b47b6a0836f60#diff-0'>
<strong>
ntpd/ntp_loopfilter.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntp_loopfilter.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntp_loopfilter.c
</span><span style="color: #aaaaaa">@@ -630,7 +630,8 @@ local_clock(
</span>                       fp_offset);
                        report_event(EVNT_CLOCKRESET, NULL, tbuf);
                        step_systime(fp_offset);
<span style="color: #000000;background-color: #ffdddd">-                        reinit_timer();
</span><span style="color: #000000;background-color: #ddffdd">+                   if (intercept_get_mode() != replay)
+                           reinit_timer();
</span>                   tc_counter = 0;
                        clock_jitter = LOGTOD(sys_precision);
                        rval = 2;
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/804a57f98785806e6393056d249b47b6a0836f60#diff-1'>
<strong>
ntpd/ntpd.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntpd.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntpd.c
</span><span style="color: #aaaaaa">@@ -135,6 +135,7 @@ char **   saved_argv;
</span> 
 #ifndef SIM
 int            ntpdmain                (int, char **);
<span style="color: #000000;background-color: #ddffdd">+static void     mainloop                (void);
</span> static void       set_process_priority    (void);
 static void    assertion_failed        (const char *, int,
                                         isc_assertiontype_t,
<span style="color: #aaaaaa">@@ -544,7 +545,6 @@ ntpdmain(
</span>   char *argv[]
        )
 {
<span style="color: #000000;background-color: #ffdddd">-        struct recvbuf *rbuf;
</span>   mode_t          uv;
        uid_t           uid;
 # if defined(HAVE_WORKING_FORK)
<span style="color: #aaaaaa">@@ -754,7 +754,6 @@ ntpdmain(
</span>   init_util();
        init_restrict();
        init_mon();
<span style="color: #000000;background-color: #ffdddd">-        init_timer();
</span>   init_control();
        init_peer();
 # ifdef REFCLOCK
<span style="color: #aaaaaa">@@ -922,8 +921,20 @@ ntpdmain(
</span>           msyslog(LOG_INFO, "running as non-root disables dynamic interface tracking");
        }
 
<span style="color: #000000;background-color: #ffdddd">-# ifdef HAVE_IO_COMPLETION_PORT
</span><span style="color: #000000;background-color: #ddffdd">+   mainloop();
+       return 1;
+}
+
+/*
+ * Process incoming packets until exit or interrupted.
+ */
+static void mainloop(void)
+{
+       struct recvbuf *rbuf;
</span> 
<span style="color: #000000;background-color: #ddffdd">+        init_timer();
+
+# ifdef HAVE_IO_COMPLETION_PORT
</span>   for (;;) {
                GetReceivedBuffers();
 # else /* normal I/O */
<span style="color: #aaaaaa">@@ -1043,7 +1054,6 @@ ntpdmain(
</span> 
        }
        UNBLOCK_IO_AND_ALARM();
<span style="color: #000000;background-color: #ffdddd">-        return 1;
</span> }
 #endif /* !SIM */
 
</code></pre>

<br>
</li>

</div>
<div class='footer' style='margin-top: 10px;'>
<p>

<br>
<a href="https://gitlab.com/NTPsec/ntpsec/commit/804a57f98785806e6393056d249b47b6a0836f60">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://gitlab.com/NTPsec/ntpsec/commit/804a57f98785806e6393056d249b47b6a0836f60"}}</script>
</p>
</div>
</body>
</html>