Skip to content
Snippets Groups Projects
Commit cbc9121a authored by Daniel Krebs's avatar Daniel Krebs
Browse files

gnrc/netif: fix source address selection for non-matching prefixes

According to RFC 6724 ch. 5 rule 8, the source address candidate with
the longest matching prefix has to be selected. The current
implementation discards source addresses that have no matching prefix
(`match = 0`) which is perfectly fine for any global address.
parent bba45729
No related branches found
No related tags found
No related merge requests found
......@@ -874,7 +874,7 @@ static unsigned _match(const gnrc_netif_t *netif, const ipv6_addr_t *addr,
}
match = ipv6_addr_match_prefix(&(netif->ipv6.addrs[i]), addr);
if (((match > 64U) || !ipv6_addr_is_link_local(&(netif->ipv6.addrs[i]))) &&
(match > best_match)) {
(match >= best_match)) {
if (idx != NULL) {
*idx = i;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment