<h1>Backport of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="944187925" data-permission-text="Title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/16643" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/16643/hovercard" href="https://github.com/RIOT-OS/RIOT/pull/16643">#16643</a></h1>

<h3>Contribution description</h3>
<p>Found this while testing <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="935888909" data-permission-text="Title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/16606" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/16606/hovercard" href="https://github.com/RIOT-OS/RIOT/pull/16606">#16606</a>: When using the <code>gnrc_netif_single</code> optimization module <code>gnrc_sock</code> basically accepts any <code>netif</code> value in the <code>gnrc_sock*_ep_t</code> structs, as it is just overwritten with the ID only existing network interface. While this seems like a nice extra from a shell user perspective, I wouldn't call this behavior valid and it also might cause some faulty behavior if e.g. invalid interface IDs are received from the network (as might be the case with DHCPv6's <a href="">Interface ID option</a> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="935888909" data-permission-text="Title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/16606" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/16606/hovercard" href="https://github.com/RIOT-OS/RIOT/pull/16606">#16606</a>).</p>

<h3>Testing procedure</h3>
<p>The following tests should still pass:</p>
<ul>
<li><code>tests/gnrc_sock_udp</code></li>
<li><code>tests/gnrc_sock_ip</code></li>
</ul>

<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/16647'>https://github.com/RIOT-OS/RIOT/pull/16647</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>gnrc_sock: imply end-point netif only if unset</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/16647/files#diff-77688bd6433457c2ca015f7faa5edf36e72d19d68d8e434ad225cdf537460d22">sys/net/gnrc/sock/include/gnrc_sock_internal.h</a>
    (2)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/16647.patch'>https://github.com/RIOT-OS/RIOT/pull/16647.patch</a></li>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/16647.diff'>https://github.com/RIOT-OS/RIOT/pull/16647.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/16647">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYFIOIG7GMA44WXKPXLTXV6BNANCNFSM5ALK5SFA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABE7WYESQDY5QSX7U6PPR4LTXV6BNA5CNFSM5ALK5SFKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4OCJ6D7Q.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/16647",
"url": "https://github.com/RIOT-OS/RIOT/pull/16647",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>