<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>
GitLab
</title>



<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">
<h3>
Ian Bruene 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/bc4c6cf24958aac9af581698bd86d6f4d3c84db1">bc4c6cf2</a></strong>
<div>
<span>by Ian Bruene</span>
<i>at 2017-08-23T15:12:44-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Fixed error in posix_to_ntp: it recieves floats so it can't shift
</pre>
</li>
</ul>
<h4>2 changed files:</h4>
<ul>
<li class="file-stats">
<a href="#e0397ae65951b0adbbedbbb14a096009aaa63642">
pylib/packet.py
</a>
</li>
<li class="file-stats">
<a href="#48b9ace875188a1a6b065b960b4d06b87955c732">
tests/pylib/test_packet.py
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id="e0397ae65951b0adbbedbbb14a096009aaa63642">
<a href="https://gitlab.com/NTPsec/ntpsec/commit/bc4c6cf24958aac9af581698bd86d6f4d3c84db1#e0397ae65951b0adbbedbbb14a096009aaa63642"><strong>pylib/packet.py</strong></a>
<hr>
<table class="code white" style="font-family: monospace; font-size: 12px;" bgcolor="#fff" width="100%" cellpadding="0" cellspacing="0">
<tr class="line_holder match" id="" style="line-height: 1.6;">
<td class="diff-line-num unfold js-unfold old_line" data-linenumber="460" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">...</td>
<td class="diff-line-num unfold js-unfold new_line" data-linenumber="460" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">...</td>
<td class="line_content match " style="padding-left: 0.5em; padding-right: 0.5em; color: rgba(0,0,0,0.3);" bgcolor="#fafafa">@@ -460,7 +460,8 @@ class SyncPacket(Packet):</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="460" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
460
</td>
<td class="diff-line-num new_line" data-linenumber="460" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
460
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC460" class="line" lang="python">    <span class="k" style="font-weight: bold;">def</span> <span class="nf" style="color: #900; font-weight: bold;">posix_to_ntp</span><span class="p">(</span><span class="n" style="color: #333;">t</span><span class="p">):</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="461" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
461
</td>
<td class="diff-line-num new_line" data-linenumber="461" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
461
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC461" class="line" lang="python">        <span class="s" style="color: #d14;">"Scale from POSIX time to NTP time"</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="462" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
462
</td>
<td class="diff-line-num new_line" data-linenumber="462" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
462
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC462" class="line" lang="python">        <span class="c" style="color: #998; font-style: italic;"># Note: assumes we're in the same NTP era as the transmitter...</span></span>
</pre>
</td>
</tr>
<tr class="line_holder old" id="" style="line-height: 1.6;">
<td class="diff-line-num old old_line" data-linenumber="463" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
463
</td>
<td class="diff-line-num new_line old" data-linenumber="463" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
 
</td>
<td class="line_content noteable_line old" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#fbe9eb">
<pre style="margin: 0;">-<span id="LC463" class="line" lang="python">        <span class="k" style="font-weight: bold;">return</span> <span class="nb" style="color: #0086b3;">int</span><span class="p">((</span><span class="n" style="color: #333;">t</span> <span class="o" style="font-weight: bold;">+</span> <span class="n" style="color: #333;">SyncPacket</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: #333;">UNIX_EPOCH</span><span class="p">)</span> <span class="o" style="font-weight: bold;"><<</span> <span class="mi" style="color: #099;">32</span><span class="p">)</span></span>
</pre>
</td>
</tr>
<tr class="line_holder new" id="" style="line-height: 1.6;">
<td class="diff-line-num new old_line" data-linenumber="464" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="diff-line-num new new_line" data-linenumber="463" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
463
</td>
<td class="line_content new noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0">
<pre style="margin: 0;">+<span id="LC463" class="line" lang="python">        <span class="c" style="color: #998; font-style: italic;"># This recieves floats, can't use shifts</span></span>
</pre>
</td>
</tr>
<tr class="line_holder new" id="" style="line-height: 1.6;">
<td class="diff-line-num new old_line" data-linenumber="464" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="diff-line-num new new_line" data-linenumber="464" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
464
</td>
<td class="line_content new noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0">
<pre style="margin: 0;">+<span id="LC464" class="line" lang="python">        <span class="k" style="font-weight: bold;">return</span> <span class="nb" style="color: #0086b3;">int</span><span class="p">((</span><span class="n" style="color: #333;">t</span> <span class="o" style="font-weight: bold;">+</span> <span class="n" style="color: #333;">SyncPacket</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: #333;">UNIX_EPOCH</span><span class="p">)</span> <span class="o" style="font-weight: bold;">*</span> <span class="mi" style="color: #099;">2</span><span class="o" style="font-weight: bold;">**</span><span class="mi" style="color: #099;">32</span><span class="p">)</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="464" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
464
</td>
<td class="diff-line-num new_line" data-linenumber="465" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
465
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC465" class="line" lang="python"></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="465" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
465
</td>
<td class="diff-line-num new_line" data-linenumber="466" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
466
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC466" class="line" lang="python">    <span class="k" style="font-weight: bold;">def</span> <span class="nf" style="color: #900; font-weight: bold;">posixize</span><span class="p">(</span><span class="bp" style="color: #999;">self</span><span class="p">):</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="466" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
466
</td>
<td class="diff-line-num new_line" data-linenumber="467" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
467
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC467" class="line" lang="python">        <span class="s" style="color: #d14;">"Rescale all timestamps to POSIX time."</span></span>
</pre>
</td>
</tr>

</table>
<br>
</li>
<li id="48b9ace875188a1a6b065b960b4d06b87955c732">
<a href="https://gitlab.com/NTPsec/ntpsec/commit/bc4c6cf24958aac9af581698bd86d6f4d3c84db1#48b9ace875188a1a6b065b960b4d06b87955c732"><strong>tests/pylib/test_packet.py</strong></a>
<hr>
<table class="code white" style="font-family: monospace; font-size: 12px;" bgcolor="#fff" width="100%" cellpadding="0" cellspacing="0">
<tr class="line_holder match" id="" style="line-height: 1.6;">
<td class="diff-line-num unfold js-unfold old_line" data-linenumber="427" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">...</td>
<td class="diff-line-num unfold js-unfold new_line" data-linenumber="427" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">...</td>
<td class="line_content match " style="padding-left: 0.5em; padding-right: 0.5em; color: rgba(0,0,0,0.3);" bgcolor="#fafafa">@@ -427,7 +427,7 @@ class TestSyncPacket(unittest.TestCase):</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="427" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
427
</td>
<td class="diff-line-num new_line" data-linenumber="427" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
427
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC427" class="line" lang="python">    <span class="k" style="font-weight: bold;">def</span> <span class="nf" style="color: #900; font-weight: bold;">test_ntp_to_posix</span><span class="p">(</span><span class="bp" style="color: #999;">self</span><span class="p">):</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="428" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
428
</td>
<td class="diff-line-num new_line" data-linenumber="428" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
428
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC428" class="line" lang="python">        <span class="n" style="color: #333;">f</span> <span class="o" style="font-weight: bold;">=</span> <span class="bp" style="color: #999;">self</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: #333;">target</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: #333;">ntp_to_posix</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="429" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
429
</td>
<td class="diff-line-num new_line" data-linenumber="429" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
429
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC429" class="line" lang="python">        <span class="c" style="color: #998; font-style: italic;"># Test the Timeless Void Before Existence</span></span>
</pre>
</td>
</tr>
<tr class="line_holder old" id="" style="line-height: 1.6;">
<td class="diff-line-num old old_line" data-linenumber="430" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
430
</td>
<td class="diff-line-num new_line old" data-linenumber="430" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
 
</td>
<td class="line_content noteable_line old" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#fbe9eb">
<pre style="margin: 0;">-<span id="LC430" class="line" lang="python">        <span class="bp" style="color: #999;">self</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: #333;">assertEqual</span><span class="p">(</span><span class="n" style="color: #333;">f</span><span class="p">(</span><span class="o" style="font-weight: bold;">-</span><span class="mi" style="color: #099;">1</span><span class="p">),</span> <span class="o" style="font-weight: bold;">-</span><span class="mi" style="color: #099;">220898880<span class="idiff left">0</span></span><span class="p"><span class="idiff">)</span></span><span class="idiff">  </span><span class="c" style="color: #998; font-style: italic;"><span class="idiff right"># NTP can't</span> see the Timeless Void</span></span>
</pre>
</td>
</tr>
<tr class="line_holder new" id="" style="line-height: 1.6;">
<td class="diff-line-num new old_line" data-linenumber="431" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="diff-line-num new new_line" data-linenumber="430" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
430
</td>
<td class="line_content new noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0">
<pre style="margin: 0;">+<span id="LC430" class="line" lang="python">        <span class="bp" style="color: #999;">self</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: #333;">assertEqual</span><span class="p">(</span><span class="n" style="color: #333;">f</span><span class="p">(</span><span class="o" style="font-weight: bold;">-</span><span class="mi" style="color: #099;">1</span><span class="p">),</span> <span class="o" style="font-weight: bold;">-</span><span class="mi" style="color: #099;">220898880<span class="idiff left">1</span></span><span class="p"><span class="idiff">)</span></span><span class="idiff">  </span><span class="c" style="color: #998; font-style: italic;"><span class="idiff right"># NTP can</span> see the Timeless Void</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="431" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
431
</td>
<td class="diff-line-num new_line" data-linenumber="431" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
431
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC431" class="line" lang="python">        <span class="c" style="color: #998; font-style: italic;"># Test beginning of NTP epoch</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="432" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
432
</td>
<td class="diff-line-num new_line" data-linenumber="432" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
432
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC432" class="line" lang="python">        <span class="bp" style="color: #999;">self</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: #333;">assertEqual</span><span class="p">(</span><span class="n" style="color: #333;">f</span><span class="p">(</span><span class="mi" style="color: #099;">0</span><span class="p">),</span> <span class="o" style="font-weight: bold;">-</span><span class="mi" style="color: #099;">2208988800</span><span class="p">)</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="433" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
433
</td>
<td class="diff-line-num new_line" data-linenumber="433" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
433
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC433" class="line" lang="python">        <span class="c" style="color: #998; font-style: italic;"># Test just before the Age of Unix</span></span>
</pre>
</td>
</tr>

</table>
<br>
</li>

</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #777;">

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