From e93b8a11ed823a39262ce20583f5df4bb8c2e568 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Fri, 22 May 2015 17:19:26 +0200 Subject: [PATCH] ipv6_netif: fix ng_ipv6_netif_find_best_src_addr() for multicast Without this fix ng_ipv6_netif_find_best_src_addr() will return :: for most multicast addresses --- sys/net/network_layer/ng_ipv6/netif/ng_ipv6_netif.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net/network_layer/ng_ipv6/netif/ng_ipv6_netif.c b/sys/net/network_layer/ng_ipv6/netif/ng_ipv6_netif.c index 0b0c310305..ac156c4682 100644 --- a/sys/net/network_layer/ng_ipv6/netif/ng_ipv6_netif.c +++ b/sys/net/network_layer/ng_ipv6/netif/ng_ipv6_netif.c @@ -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; }