Commit 03885d1c authored by Jukka Rissanen's avatar Jukka Rissanen Committed by Carles Cufi
Browse files

net: if: No need to join mcast groups if interface IPv6 is disabled



If IPv6 is not enabled for a given network interface, then there
is no need to try to join IPv6 multicast groups as it will just
cause an error print which is pointless in this case.

Signed-off-by: default avatarJukka Rissanen <jukka.rissanen@nordicsemi.no>
parent 427e506d
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1105,6 +1105,10 @@ static void join_mcast_allnodes(struct net_if *iface)
	struct in6_addr addr;
	int ret;

	if (iface->config.ip.ipv6 == NULL) {
		return;
	}

	net_ipv6_addr_create_ll_allnodes_mcast(&addr);

	ret = net_ipv6_mld_join(iface, &addr);
@@ -1121,6 +1125,10 @@ static void join_mcast_solicit_node(struct net_if *iface,
	struct in6_addr addr;
	int ret;

	if (iface->config.ip.ipv6 == NULL) {
		return;
	}

	/* Join to needed multicast groups, RFC 4291 ch 2.8 */
	net_ipv6_addr_create_solicited_node(my_addr, &addr);

@@ -1161,6 +1169,10 @@ static void join_mcast_nodes(struct net_if *iface, struct in6_addr *addr)
{
	enum net_l2_flags flags = 0;

	if (iface->config.ip.ipv6 == NULL) {
		return;
	}

	flags = l2_flags_get(iface);
	if (flags & NET_L2_MULTICAST) {
		join_mcast_allnodes(iface);