1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-30 17:01:19 +01:00

gnrc/ipv6: only send link-local loopback if it's on the same interface

This commit is contained in:
Benjamin Valentin 2024-01-22 20:03:41 +01:00
parent 3159578cbe
commit 616a5d69f6

View File

@ -714,6 +714,11 @@ static void _send(gnrc_pktsnip_t *pkt, bool prep_hdr)
else {
gnrc_netif_t *tmp_netif = gnrc_netif_get_by_ipv6_addr(&ipv6_hdr->dst);
/* only consider link-local addresses on the interface we are sending on */
if (tmp_netif != netif && ipv6_addr_is_link_local(&ipv6_hdr->dst)) {
tmp_netif = NULL;
}
if (ipv6_addr_is_loopback(&ipv6_hdr->dst) || /* dst is loopback address */
/* or dst registered to a local interface */
(tmp_netif != NULL)) {