<h3>Contribution description</h3>
<p>During <a href="https://github.com/miri64/RIOT_playground/tree/30a37a76b57211b6253ab64139ee9eccf959c9c5/lndw18_luke">a demo</a> for LNdW in Berlin] last weekend, we faced the problem, that the nodes oftentimes registered with their link-local address to the resource directory. This was caused by a bug in the duplicate address detection, causing the global address never to become valid.</p>
<p>The <code>addr</code> parameter of the NIB's <code>_handle_dad()</code> can come from anywhere (e.g. in the fallback to classic SLAAC the destination address of the IP header is used),</p>
<p><div class="border rounded-1 my-2">
  <div class="f6 px-3 py-2 lh-condensed border-bottom bg-gray-light">
    <p class="mb-0 text-bold">
      <a href="https://github.com/RIOT-OS/RIOT/blob/f32ab700cb68567b87f3854f3c78c594b19a1c6c/sys/net/gnrc/network_layer/ipv6/nib/nib.c#L1085-L1092">RIOT/sys/net/gnrc/network_layer/ipv6/nib/nib.c</a>
    </p>
    <p class="mb-0 text-gray-light">
        Lines 1085 to 1092
      in
      <a data-pjax="true" class="commit-tease-sha" href="/RIOT-OS/RIOT/commit/f32ab700cb68567b87f3854f3c78c594b19a1c6c">f32ab70</a>
    </p>
    </div>
    <div itemprop="text" class="blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8">

        <tbody><tr class="border-0">
          <td id="L1085" class="blob-num border-0 px-3 py-0 bg-white js-line-number" data-line-number="1085"></td>
          <td id="LC1085" class="blob-code border-0 px-3 py-0 bg-white blob-code-inner js-file-line"> #<span class="pl-k">if</span> GNRC_IPV6_NIB_CONF_SLAAC && GNRC_IPV6_NIB_CONF_6LN </td>
        </tr>

        <tr class="border-0">
          <td id="L1086" class="blob-num border-0 px-3 py-0 bg-white js-line-number" data-line-number="1086"></td>
          <td id="LC1086" class="blob-code border-0 px-3 py-0 bg-white blob-code-inner js-file-line">         <span class="pl-c"><span class="pl-c">/*</span> 6Lo-ND duplicate address detection (DAD) was ignored by neighbor, try</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L1087" class="blob-num border-0 px-3 py-0 bg-white js-line-number" data-line-number="1087"></td>
          <td id="LC1087" class="blob-code border-0 px-3 py-0 bg-white blob-code-inner js-file-line"> <span class="pl-c">         * traditional DAD <span class="pl-c">*/</span></span> </td>
        </tr>

        <tr class="border-0">
          <td id="L1088" class="blob-num border-0 px-3 py-0 bg-white js-line-number" data-line-number="1088"></td>
          <td id="LC1088" class="blob-code border-0 px-3 py-0 bg-white blob-code-inner js-file-line">         <span class="pl-k">if</span> ((aro_status == _ADDR_REG_STATUS_UNAVAIL) && </td>
        </tr>

        <tr class="border-0">
          <td id="L1089" class="blob-num border-0 px-3 py-0 bg-white js-line-number" data-line-number="1089"></td>
          <td id="LC1089" class="blob-code border-0 px-3 py-0 bg-white blob-code-inner js-file-line">             <span class="pl-c1">gnrc_netif_is_6ln</span>(netif)) { </td>
        </tr>

        <tr class="border-0">
          <td id="L1090" class="blob-num border-0 px-3 py-0 bg-white js-line-number" data-line-number="1090"></td>
          <td id="LC1090" class="blob-code border-0 px-3 py-0 bg-white blob-code-inner js-file-line">             <span class="pl-c1">_handle_dad</span>(&ipv6-><span class="pl-smi">dst</span>); </td>
        </tr>

        <tr class="border-0">
          <td id="L1091" class="blob-num border-0 px-3 py-0 bg-white js-line-number" data-line-number="1091"></td>
          <td id="LC1091" class="blob-code border-0 px-3 py-0 bg-white blob-code-inner js-file-line">         } </td>
        </tr>

        <tr class="border-0">
          <td id="L1092" class="blob-num border-0 px-3 py-0 bg-white js-line-number" data-line-number="1092"></td>
          <td id="LC1092" class="blob-code border-0 px-3 py-0 bg-white blob-code-inner js-file-line"> #<span class="pl-k">elif</span> GNRC_IPV6_NIB_CONF_6LN </td>
        </tr>
    </tbody></table>
  </div>
</div>
</p>
<p>so putting that pointer in a timer is not a good idea. Instead we use the version of<br>
the address that is stored within the interface.</p>

<h3>Testing procedure</h3>
<p>Since it may happen that <code>addr</code> still contains the correct address (and only occurs when working with a Raspberry Pi), when the timer is fired, this is not easy to reproduce. But here is a try.</p>
<p>Make sure <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/RIOT-OS/RIOT/commit/484526533df018cbeabfc24eec4a00c58c3ab90e/hovercard" href="https://github.com/RIOT-OS/RIOT/commit/484526533df018cbeabfc24eec4a00c58c3ab90e"><tt>4845265</tt></a> is in your tested version!</p>
<p>Enable DEBUG in <code>sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c</code> and flash <code>gnrc_networking</code> to multiple 6LoWPAN-capable nodes (remember to set <code>-DGNRC_IPV6_NIB_CONF_SLAAC=1</code> in <code>CFLAGS</code>). Have a a Raspberry Pi with a 6LoWPAN-capable interface and reset all the nodes. Without the last change, some of the nodes will output garbage in the debug output. With it it will always be the global address.</p>

<h3>Issues/PRs references</h3>
<p>None</p>


<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/RIOT-OS/RIOT/pull/11716'>https://github.com/RIOT-OS/RIOT/pull/11716</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>gnrc_ipv6_nib/SLAAC: add debug message for address validation</li>
  <li>gnrc_ipv6_nib: add debug messages for DAD + 6Lo</li>
  <li>gnrc_ipv6_nib: add address from netif to address validation timer</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11716/files#diff-0">sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11716/files#diff-1">sys/net/gnrc/network_layer/ipv6/nib/nib.c</a>
    (3)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/11716.patch'>https://github.com/RIOT-OS/RIOT/pull/11716.patch</a></li>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/11716.diff'>https://github.com/RIOT-OS/RIOT/pull/11716.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/11716?email_source=notifications&email_token=ABE7WYB2VR2VHCZ5IIR6GZDP3CYOJA5CNFSM4HY6O4T2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2DDPFA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYHXS6QDCQJP2HQX23TP3CYOJANCNFSM4HY6O4TQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYAGUBULD3WCV7FKLWDP3CYOJA5CNFSM4HY6O4T2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2DDPFA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/11716?email_source=notifications\u0026email_token=ABE7WYB2VR2VHCZ5IIR6GZDP3CYOJA5CNFSM4HY6O4T2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2DDPFA",
"url": "https://github.com/RIOT-OS/RIOT/pull/11716?email_source=notifications\u0026email_token=ABE7WYB2VR2VHCZ5IIR6GZDP3CYOJA5CNFSM4HY6O4T2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2DDPFA",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>