Skip to content

Commit

Permalink
ipv6_netif: fix ipv6_get_best_src_addr() for multicast
Browse files Browse the repository at this point in the history
Without this fix ipv6_get_best_src_addr() will return :: for most
multicast addresses
  • Loading branch information
miri64 committed May 22, 2015
1 parent 7be7e00 commit 5db5722
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sys/net/network_layer/ng_ipv6/netif/ng_ipv6_netif.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ static uint8_t _find_by_prefix_unsafe(ng_ipv6_addr_t **res, ng_ipv6_netif_t *ifa

match = ng_ipv6_addr_match_prefix(&(iface->addrs[i].addr), addr);

if (match < iface->addrs[i].prefix_len) {
if (only_unicast && !ng_ipv6_addr_is_multicast(addr) &&
(match < iface->addrs[i].prefix_len)) {
/* match but not of same subnet */
continue;
}
Expand Down

0 comments on commit 5db5722

Please sign in to comment.