net: IPv6: Fix source address for mesh multicast destination
Currently there is chosen the link local address as a source address for each multicast destination address. It is a bug for OpenThread network where the mesh-local EID addres should be picked in this case. This commit fixes it by distinquish the mesh local multicast among any others. Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
This commit is contained in:
parent
4b194eb4fc
commit
b0de2ee15b
2 changed files with 18 additions and 3 deletions
|
@ -2347,7 +2347,8 @@ static struct in6_addr *net_if_ipv6_get_best_match(struct net_if *iface,
|
|||
/* Mesh local address can only be selected for the same
|
||||
* subnet.
|
||||
*/
|
||||
if (ipv6->unicast[i].is_mesh_local && len < 64) {
|
||||
if (ipv6->unicast[i].is_mesh_local && len < 64 &&
|
||||
!net_ipv6_is_addr_mcast_mesh(dst)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -2366,8 +2367,8 @@ const struct in6_addr *net_if_ipv6_select_src_addr(struct net_if *dst_iface,
|
|||
uint8_t best_match = 0U;
|
||||
struct net_if *iface;
|
||||
|
||||
if (!net_ipv6_is_ll_addr(dst) && !net_ipv6_is_addr_mcast(dst)) {
|
||||
|
||||
if (!net_ipv6_is_ll_addr(dst) && (!net_ipv6_is_addr_mcast(dst) ||
|
||||
net_ipv6_is_addr_mcast_mesh(dst))) {
|
||||
for (iface = __net_if_start;
|
||||
!dst_iface && iface != __net_if_end;
|
||||
iface++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue