<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/fda68b3c875068e083759eb3ce44c09e45988ac7">fda68b3c</a></strong>
<div>
<span>by Eric S. Raymond</span>
<i>at 2015-12-13T12:05:50Z</i>
</div>
<pre class='commit-message'>Replay checkpoint: cope with random number of calls in measre_tick_fuzz</pre>
</li>
</ul>
<h4>2 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
ntpd/ntp_intercept.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
ntpd/ntp_proto.c
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/fda68b3c875068e083759eb3ce44c09e45988ac7#diff-0'>
<strong>
ntpd/ntp_intercept.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntp_intercept.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntp_intercept.c
</span><span style="color: #aaaaaa">@@ -110,6 +110,7 @@ static intercept_mode mode = none;
</span> 
 static char linebuf[256];
 static int lineno;
<span style="color: #000000;background-color: #ddffdd">+static double saved_drift;
</span> 
 intercept_mode intercept_get_mode(void)
 {
<span style="color: #aaaaaa">@@ -140,8 +141,8 @@ static void get_operation(const char *expect)
</span>   }
            
        if (expect != NULL && strncmp(linebuf, expect, strlen(expect)) != 0) {
<span style="color: #000000;background-color: #ffdddd">-            fprintf(stderr, "ntpd: replay failed, expected %s but saw %*s\n",
-                   expect, (int)strlen(expect), linebuf);
</span><span style="color: #000000;background-color: #ddffdd">+       fprintf(stderr, "ntpd: replay failed on line %d, expected %s but saw %*s",
+                   lineno, expect, (int)strlen(expect), linebuf);
</span>       exit(1);
        }
            
<span style="color: #aaaaaa">@@ -251,8 +252,15 @@ void intercept_getconfig(const char *configfile)
</span>   /* this can be null if the default config doesn't exist */
        configfile = getconfig(configfile);
 
<span style="color: #000000;background-color: #ffdddd">-        if (configfile != NULL && mode != none)
</span><span style="color: #000000;background-color: #ddffdd">+   if (configfile != NULL && mode == capture)
</span>       pump(configfile, "startconfig\n", "endconfig\n", stdout);
<span style="color: #000000;background-color: #ddffdd">+        /*
+        * Has to be done here because intercept_drift_read() is called from
+        * inside the config parser - otherwise, things get emitted in the
+        * wrong order.
+        */
+       if (mode == capture)
+           printf("drift-read %.3f\n", saved_drift);
</span>     }
 }
 
<span style="color: #aaaaaa">@@ -337,7 +345,7 @@ bool intercept_drift_read(const char *drift_file, double *drift)
</span> {
     if (mode == replay) {
        float df;
<span style="color: #000000;background-color: #ffdddd">-        get_operation("drift_read ");
</span><span style="color: #000000;background-color: #ddffdd">+   get_operation("drift-read ");
</span>   if (strstr(linebuf, "false") != NULL)
            return false;
        /*
<span style="color: #aaaaaa">@@ -372,8 +380,8 @@ bool intercept_drift_read(const char *drift_file, double *drift)
</span>   }
        fclose(fp);
 
<span style="color: #000000;background-color: #ffdddd">-        if (mode == capture)
-           printf("drift-read %.3f\n", *drift);
</span><span style="color: #000000;background-color: #ddffdd">+   /* capture write has to be done in the config intercwept */
+       saved_drift = *drift;
</span>     }
 
     return true;
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/fda68b3c875068e083759eb3ce44c09e45988ac7#diff-1'>
<strong>
ntpd/ntp_proto.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntp_proto.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntp_proto.c
</span><span style="color: #aaaaaa">@@ -4029,7 +4029,11 @@ measure_tick_fuzz(void)
</span>   DTOLFP(MINSTEP, &minstep);
        intercept_get_systime(__func__, &last);
        for (i = 0; i < MAXLOOPS && changes < MINCHANGES; i++) {
<span style="color: #000000;background-color: #ffdddd">-                intercept_get_systime(__func__, &val);
</span><span style="color: #000000;background-color: #ddffdd">+           /*
+                * Not intercepted because it's called a variable
+                * number of times, which screws up replay.
+                */
+               get_systime(&val);
</span>           ldiff = val;
                L_SUB(&ldiff, &last);
                last = val;
</code></pre>

<br>
</li>

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

<br>
<a href="https://gitlab.com/NTPsec/ntpsec/commit/fda68b3c875068e083759eb3ce44c09e45988ac7">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/fda68b3c875068e083759eb3ce44c09e45988ac7"}}</script>
</p>
</div>
</body>
</html>