Skip to content

Commit 9074c07

Browse files
kderdacarlescufi
authored andcommitted
net: ipv6: mld: use proper MLDv2 modes
According to the RFC, MODE_IS_INCLUDE/MODE_IS_EXCLUDE codes should be used while sendling Multicast Listener Reports in response to a query. When performing a transition between states (e.g., when joining or leaving a multicast group) CHANGE_TO_INCLUDE_MODE/CHANGE_TO_EXCLUDE_MODE have to be used. Signed-off-by: Konrad Derda <[email protected]>
1 parent 7f5a481 commit 9074c07

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

subsys/net/ip/ipv6_mld.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ int net_ipv6_mld_join(struct net_if *iface, const struct in6_addr *addr)
234234
return -ENETDOWN;
235235
}
236236

237-
ret = net_ipv6_mld_send_single(iface, addr, NET_IPV6_MLDv2_MODE_IS_EXCLUDE);
237+
ret = net_ipv6_mld_send_single(iface, addr, NET_IPV6_MLDv2_CHANGE_TO_EXCLUDE_MODE);
238238
if (ret < 0) {
239239
return ret;
240240
}
@@ -268,7 +268,7 @@ int net_ipv6_mld_leave(struct net_if *iface, const struct in6_addr *addr)
268268
return 0;
269269
}
270270

271-
ret = net_ipv6_mld_send_single(iface, addr, NET_IPV6_MLDv2_MODE_IS_INCLUDE);
271+
ret = net_ipv6_mld_send_single(iface, addr, NET_IPV6_MLDv2_CHANGE_TO_INCLUDE_MODE);
272272
if (ret < 0) {
273273
return ret;
274274
}

subsys/net/ip/route.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,8 +805,8 @@ static void propagate_mld_event(struct net_route_entry_mcast *route, bool route_
805805
/* Apply only for complete addresses */
806806
if (route->prefix_len == 128) {
807807
mld_event.addr = &route->group;
808-
mld_event.mode = route_added ? NET_IPV6_MLDv2_MODE_IS_EXCLUDE :
809-
NET_IPV6_MLDv2_MODE_IS_INCLUDE;
808+
mld_event.mode = route_added ? NET_IPV6_MLDv2_CHANGE_TO_EXCLUDE_MODE :
809+
NET_IPV6_MLDv2_CHANGE_TO_INCLUDE_MODE;
810810

811811
net_if_foreach(send_mld_event, &mld_event);
812812
}

0 commit comments

Comments
 (0)