1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

gnrc_ndp: only send RAs when VALID address is found

Otherwise, it may happen that `::` or a global address is chosen by
the IPv6 header fill function. Both types of addresses are
[not valid for RAs](https://tools.ietf.org/html/rfc4861#section-4.2)
This commit is contained in:
Martine Lenders 2018-04-10 13:48:35 +02:00
parent 55adbee488
commit 22ad3aa12e

View File

@ -475,6 +475,11 @@ void gnrc_ndp_rtr_adv_send(gnrc_netif_t *netif, const ipv6_addr_t *src,
/* get address from source selection algorithm. /* get address from source selection algorithm.
* Only link local addresses may be used (RFC 4861 section 4.1) */ * Only link local addresses may be used (RFC 4861 section 4.1) */
src = gnrc_netif_ipv6_addr_best_src(netif, dst, true); src = gnrc_netif_ipv6_addr_best_src(netif, dst, true);
if (src == NULL) {
DEBUG("ndp rtr: no VALID source address found for RA\n");
break;
}
} }
/* add SL2A for source address */ /* add SL2A for source address */
if (src != NULL) { if (src != NULL) {