<h3>Contribution description</h3>
<p>This PR fixes the Bug introduced in <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="474512599" data-permission-text="Issue title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/11933" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/11933/hovercard" href="https://github.com/RIOT-OS/RIOT/pull/11933">#11933</a>.</p>
<h3>Testing procedure</h3>
<p>Follow the testing procedure in <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="443466126" data-permission-text="Issue title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/11519" data-hovercard-type="issue" data-hovercard-url="/RIOT-OS/RIOT/issues/11519/hovercard" href="https://github.com/RIOT-OS/RIOT/issues/11519">#11519</a>. To test in a controlled setting follow the testing procedure sugested by <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=64743" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/benemorius">@benemorius</a>:</p>
<p>To test this in a controlled setting I captured and injected ping replies with a Linux node connected via a border router to a Riot node using this procedure:</p>
<ol>
<li>Prepare Linux node to capture its own outgoing ping reply:<br>
<code>tcpdump -i eth0 "icmp6 && ip6[40] == 129" -n -c1 -w icmp-reply.pcap</code></li>
<li>Use the border router to block the genuine ping reply from reaching the Riot node:<br>
<code>ip6tables -I FORWARD -o lowpan0 -p icmpv6 --icmpv6-type echo-reply -j DROP</code></li>
<li>Ping Linux node from Riot node using 1 ping and a 60 second timeout:<br>
<code>ping6 2001:470:4bb0:ffff::1 -c 1 -W 60000</code></li>
<li>On Linux node modify the source address of the captured packet:<br>
<code>tcprewrite --infile=icmp-reply.pcap --outfile=icmp-reply2.pcap --pnat=[2001:470:4bb0:ffff::1]:[2001:470:4bb0:ffff::2]</code></li>
<li>On border router unblock ping replies:<br>
<code>ip6tables -D FORWARD -o lowpan0 -p icmpv6 --icmpv6-type echo-reply -j DROP</code></li>
<li>On Linux node send modified ping reply:<br>
<code>tcpreplay --intf1=eth0 icmp-reply2.pcap</code></li>
<li>Observe whether the Riot node prints the reply. It should not.<br>
<code>12 bytes from 2001:470:4bb0:ffff::2 id:0xbe45/0xbe45 icmp_seq=0 ttl=63 rssi=-85 dBm time=13823.374 ms</code></li>
<li>As before, block ping replies at the border router:<br>
<code>ip6tables -I FORWARD -o lowpan0 -p icmpv6 --icmpv6-type echo-reply -j DROP</code></li>
<li>As before, send a ping from the Riot node:<br>
<code>ping6 2001:470:4bb0:ffff::1 -c 1 -W 60000</code></li>
<li>As before, unblock ping replies:<br>
<code>ip6tables -D FORWARD -o lowpan0 -p icmpv6 --icmpv6-type echo-reply -j DROP</code></li>
<li>From the Linux node send the unmodified ping reply captured earlier:<br>
<code>tcpreplay --intf1=eth0 icmp-reply.pcap</code></li>
<li>Observe whether the Riot node prints the reply. It should not.<br>
<code>12 bytes from 2001:470:4bb0:ffff::1 id:0xbe45/0x2e08 icmp_seq=0 ttl=63 rssi=-86 dBm time=52156.860 ms</code></li>
</ol>
<h3>Issues/PRs references</h3>
<p><span class="issue-keyword tooltipped tooltipped-se" aria-label="This pull request closes issue #11519.">Fixes</span> <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="443466126" data-permission-text="Issue title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/11519" data-hovercard-type="issue" data-hovercard-url="/RIOT-OS/RIOT/issues/11519/hovercard" href="https://github.com/RIOT-OS/RIOT/issues/11519">#11519</a></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/12159'>https://github.com/RIOT-OS/RIOT/pull/12159</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>shell/commands: fix, only accept proper pong response</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/12159/files#diff-0">sys/shell/commands/sc_gnrc_icmpv6_echo.c</a>
    (2)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/12159.patch'>https://github.com/RIOT-OS/RIOT/pull/12159.patch</a></li>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/12159.diff'>https://github.com/RIOT-OS/RIOT/pull/12159.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/12159?email_source=notifications&email_token=ABE7WYE3ZOWZH7VHG7I4UIDQHYFGRA5CNFSM4ITCZD2KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HI44JUQ">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYEFGTFMR4HQ32Q4OQDQHYFGRANCNFSM4ITCZD2A">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYHXRBT6AWPTRLRK5U3QHYFGRA5CNFSM4ITCZD2KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HI44JUQ.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/12159?email_source=notifications\u0026email_token=ABE7WYE3ZOWZH7VHG7I4UIDQHYFGRA5CNFSM4ITCZD2KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HI44JUQ",
"url": "https://github.com/RIOT-OS/RIOT/pull/12159?email_source=notifications\u0026email_token=ABE7WYE3ZOWZH7VHG7I4UIDQHYFGRA5CNFSM4ITCZD2KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HI44JUQ",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>