<!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>
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/637087c312d036be6998f44ea026e8655547d4f9">637087c3</a></strong>
<div>
<span>by Eric S. Raymond</span>
<i>at 2017-08-14T17:34:31-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Address GitLab issue #314: Forward-confirmed reverse DNS

Don't crap out on DNS failure, and add a TTL in the cache.
</pre>
</li>
</ul>
<h4>1 changed file:</h4>
<ul>
<li class="file-stats">
<a href="#a61fb9541c7ffe95e3b809ea55001114580d13e4">
pylib/util.py
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id="a61fb9541c7ffe95e3b809ea55001114580d13e4">
<a href="https://gitlab.com/NTPsec/ntpsec/commit/637087c312d036be6998f44ea026e8655547d4f9#a61fb9541c7ffe95e3b809ea55001114580d13e4"><strong>pylib/util.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="472" 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="472" 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">@@ -472,8 +472,11 @@ canonicalization_cache = {}</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="472" 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">
472
</td>
<td class="diff-line-num new_line" data-linenumber="472" 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">
472
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC472" 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="473" 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">
473
</td>
<td class="diff-line-num new_line" data-linenumber="473" 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">
473
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC473" class="line" lang="python"><span class="k" style="font-weight: bold;">def</span> <span class="nf" style="color: #900; font-weight: bold;">canonicalize_dns</span><span class="p">(</span><span class="n" style="color: #333;">inhost</span><span class="p">,</span> <span class="n" style="color: #333;">family</span><span class="o" style="font-weight: bold;">=</span><span class="n" style="color: #333;">socket</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: #333;">AF_UNSPEC</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="474" 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">
474
</td>
<td class="diff-line-num new_line" data-linenumber="474" 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">
474
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC474" class="line" lang="python">    <span class="s" style="color: #d14;">"Canonicalize a hostname or numeric IP address."</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="475" 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="475" 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">
475
</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="LC475" class="line" lang="python">    <span class="n" style="color: #333;">TTL</span> <span class="o" style="font-weight: bold;">=</span> <span class="mi" style="color: #099;">300</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="475" 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">
475
</td>
<td class="diff-line-num new_line" data-linenumber="476" 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">
476
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC476" class="line" lang="python">    <span class="k" style="font-weight: bold;">if</span> <span class="n" style="color: #333;">inhost</span> <span class="ow" style="font-weight: bold;">in</span> <span class="n" style="color: #333;">canonicalization_cache</span><span class="p">:</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="476" 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">
476
</td>
<td class="diff-line-num new_line old" data-linenumber="477" 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="LC476" class="line" lang="python">        <span class="k" style="font-weight: bold;">return</span> <span class="n" style="color: #333;">canonicalization_cache</span><span class="p">[</span><span class="n" style="color: #333;">inhost</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="477" 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="477" 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">
477
</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="LC477" class="line" lang="python">        <span class="p">(</span><span class="n" style="color: #333;">resname</span><span class="p">,</span> <span class="n" style="color: #333;">restime</span><span class="p">)</span> <span class="o" style="font-weight: bold;">=</span> <span class="n" style="color: #333;">canonicalization_cache</span><span class="p">[</span><span class="n" style="color: #333;">inhost</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="477" 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="478" 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">
478
</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="LC478" class="line" lang="python">        <span class="k" style="font-weight: bold;">if</span> <span class="n" style="color: #333;">restime</span> <span class="o" style="font-weight: bold;">>=</span> <span class="n" style="color: #333;">time</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: #333;">time</span><span class="p">()</span> <span class="o" style="font-weight: bold;">-</span> <span class="n" style="color: #333;">TTL</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="477" 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="479" 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">
479
</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="LC479" class="line" lang="python">            <span class="k" style="font-weight: bold;">return</span> <span class="n" style="color: #333;">resname</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="477" 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">
477
</td>
<td class="diff-line-num new_line" data-linenumber="480" 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">
480
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC480" class="line" lang="python">    <span class="c" style="color: #998; font-style: italic;"># Catch garbaged hostnames in corrupted Mode 6 responses</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="478" 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">
478
</td>
<td class="diff-line-num new_line" data-linenumber="481" 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">
481
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC481" class="line" lang="python">    <span class="n" style="color: #333;">m</span> <span class="o" style="font-weight: bold;">=</span> <span class="n" style="color: #333;">re</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: #333;">match</span><span class="p">(</span><span class="s" style="color: #d14;">"([:.[</span><span class="err" style="color: #a61717; background-color: #e3d2d2;">\</span><span class="s" style="color: #d14;">]]|</span><span class="err" style="color: #a61717; background-color: #e3d2d2;">\</span><span class="s" style="color: #d14;">w)*"</span><span class="p">,</span> <span class="n" style="color: #333;">inhost</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="479" 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">
479
</td>
<td class="diff-line-num new_line" data-linenumber="482" 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">
482
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC482" class="line" lang="python">    <span class="k" style="font-weight: bold;">if</span> <span class="ow" style="font-weight: bold;">not</span> <span class="n" style="color: #333;">m</span><span class="p">:</span></span>
</pre>
</td>
</tr>
<tr class="line_holder match" id="" style="line-height: 1.6;">
<td class="diff-line-num unfold js-unfold old_line" data-linenumber="483" 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="486" 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">@@ -483,8 +486,7 @@ def canonicalize_dns(inhost, family=socket.AF_UNSPEC):</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="483" 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">
483
</td>
<td class="diff-line-num new_line" data-linenumber="486" 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">
486
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC486" class="line" lang="python">        <span class="n" style="color: #333;">ai</span> <span class="o" style="font-weight: bold;">=</span> <span class="n" style="color: #333;">socket</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: #333;">getaddrinfo</span><span class="p">(</span><span class="n" style="color: #333;">hostname</span><span class="p">,</span> <span class="bp" style="color: #999;">None</span><span class="p">,</span> <span class="n" style="color: #333;">family</span><span class="p">,</span> <span class="mi" style="color: #099;">0</span><span class="p">,</span> <span class="mi" style="color: #099;">0</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="484" 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">
484
</td>
<td class="diff-line-num new_line" data-linenumber="487" 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">
487
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC487" class="line" lang="python">                                <span class="n" style="color: #333;">socket</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: #333;">AI_CANONNAME</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="485" 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">
485
</td>
<td class="diff-line-num new_line" data-linenumber="488" 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">
488
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC488" class="line" lang="python">    <span class="k" style="font-weight: bold;">except</span> <span class="n" style="color: #333;">socket</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: #333;">gaierror</span> <span class="k" style="font-weight: bold;">as</span> <span class="n" style="color: #333;">e</span><span class="p">:</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="486" 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">
486
</td>
<td class="diff-line-num new_line old" data-linenumber="489" 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="LC486" class="line" lang="python">        <span class="k" style="font-weight: bold;">print</span><span class="p">(</span><span class="s" style="color: #d14;">'getaddrinfo failed: </span><span class="si" style="color: #d14;">%</span><span class="s" style="color: #d14;">s'</span> <span class="o" style="font-weight: bold;">%</span> <span class="n" style="color: #333;">e</span><span class="p">,</span> <span class="nb" style="color: #0086b3;">file</span><span class="o" style="font-weight: bold;">=</span><span class="n" style="color: #333;">sys</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: #333;">stderr</span><span class="p">)</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="487" 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">
487
</td>
<td class="diff-line-num new_line old" data-linenumber="489" 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="LC487" class="line" lang="python">        <span class="k" style="font-weight: bold;">raise</span> <span class="nb" style="color: #0086b3;">SystemExit</span><span class="p">(</span><span class="mi" style="color: #099;">1</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="488" 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="489" 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">
489
</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="LC489" class="line" lang="python">        <span class="k" style="font-weight: bold;">return</span> <span class="s" style="color: #d14;">"DNSFAIL:</span><span class="si" style="color: #d14;">%</span><span class="s" style="color: #d14;">s"</span> <span class="o" style="font-weight: bold;">%</span> <span class="n" style="color: #333;">hostname</span> </span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="488" 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">
488
</td>
<td class="diff-line-num new_line" data-linenumber="490" 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">
490
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC490" class="line" lang="python">    <span class="p">(</span><span class="n" style="color: #333;">family</span><span class="p">,</span> <span class="n" style="color: #333;">socktype</span><span class="p">,</span> <span class="n" style="color: #333;">proto</span><span class="p">,</span> <span class="n" style="color: #333;">canonname</span><span class="p">,</span> <span class="n" style="color: #333;">sockaddr</span><span class="p">)</span> <span class="o" style="font-weight: bold;">=</span> <span class="n" style="color: #333;">ai</span><span class="p">[</span><span class="mi" style="color: #099;">0</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="489" 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">
489
</td>
<td class="diff-line-num new_line" data-linenumber="491" 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">
491
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC491" class="line" lang="python">    <span class="k" style="font-weight: bold;">try</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="490" 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">
490
</td>
<td class="diff-line-num new_line" data-linenumber="492" 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">
492
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC492" class="line" lang="python">        <span class="n" style="color: #333;">name</span> <span class="o" style="font-weight: bold;">=</span> <span class="n" style="color: #333;">socket</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: #333;">getnameinfo</span><span class="p">(</span><span class="n" style="color: #333;">sockaddr</span><span class="p">,</span> <span class="n" style="color: #333;">socket</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: #333;">NI_NAMEREQD</span><span class="p">)</span></span>
</pre>
</td>
</tr>
<tr class="line_holder match" id="" style="line-height: 1.6;">
<td class="diff-line-num unfold js-unfold old_line" data-linenumber="494" 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="496" 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">@@ -494,7 +496,7 @@ def canonicalize_dns(inhost, family=socket.AF_UNSPEC):</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="494" 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">
494
</td>
<td class="diff-line-num new_line" data-linenumber="496" 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">
496
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC496" class="line" lang="python">        <span class="c" style="color: #998; font-style: italic;"># Fall back to the hostname.</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="495" 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">
495
</td>
<td class="diff-line-num new_line" data-linenumber="497" 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">
497
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC497" class="line" lang="python">        <span class="n" style="color: #333;">canonicalized</span> <span class="o" style="font-weight: bold;">=</span> <span class="n" style="color: #333;">canonname</span> <span class="ow" style="font-weight: bold;">or</span> <span class="n" style="color: #333;">hostname</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="496" 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">
496
</td>
<td class="diff-line-num new_line" data-linenumber="498" 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">
498
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC498" class="line" lang="python">        <span class="n" style="color: #333;">result</span> <span class="o" style="font-weight: bold;">=</span> <span class="n" style="color: #333;">canonicalized</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: #333;">lower</span><span class="p">()</span> <span class="o" style="font-weight: bold;">+</span> <span class="n" style="color: #333;">portsuffix</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="497" 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">
497
</td>
<td class="diff-line-num new_line old" data-linenumber="499" 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="LC497" class="line" lang="python">    <span class="n" style="color: #333;">canonicalization_cache</span><span class="p">[</span><span class="n" style="color: #333;">inhost</span><span class="p">]</span> <span class="o" style="font-weight: bold;">=</span> <span class="n" style="color: #333;"><span class="idiff left right">result</span></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="498" 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="499" 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">
499
</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="LC499" class="line" lang="python">    <span class="n" style="color: #333;">canonicalization_cache</span><span class="p">[</span><span class="n" style="color: #333;">inhost</span><span class="p">]</span> <span class="o" style="font-weight: bold;">=</span> <span class="p"><span class="idiff left">(</span></span><span class="n" style="color: #333;"><span class="idiff">result</span></span><span class="p"><span class="idiff">,</span></span><span class="idiff"> </span><span class="n" style="color: #333;"><span class="idiff">time</span></span><span class="o" style="font-weight: bold;"><span class="idiff">.</span></span><span class="n" style="color: #333;"><span class="idiff">time</span></span><span class="p"><span class="idiff right">())</span></span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="498" 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">
498
</td>
<td class="diff-line-num new_line" data-linenumber="500" 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">
500
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC500" class="line" lang="python">    <span class="k" style="font-weight: bold;">return</span> <span class="n" style="color: #333;">result</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="499" 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">
499
</td>
<td class="diff-line-num new_line" data-linenumber="501" 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">
501
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC501" 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="500" 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">
500
</td>
<td class="diff-line-num new_line" data-linenumber="502" 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">
502
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC502" class="line" lang="python"><span class="n" style="color: #333;">TermSize</span> <span class="o" style="font-weight: bold;">=</span> <span class="n" style="color: #333;">collections</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: #333;">namedtuple</span><span class="p">(</span><span class="s" style="color: #d14;">"TermSize"</span><span class="p">,</span> <span class="p">[</span><span class="s" style="color: #d14;">"width"</span><span class="p">,</span> <span class="s" style="color: #d14;">"height"</span><span class="p">])</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/637087c312d036be6998f44ea026e8655547d4f9">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/637087c312d036be6998f44ea026e8655547d4f9"}}</script>
</p>
</div>
</body>
</html>