Skip to content

Commit 92e56cd

Browse files
author
Sathish Kumar Mani
committed
Fixes IPv6 multicast join issue
Problem Statement: During multicast join sequence, InternetSocket::join_multicast_group() calls InternetSocket::modify_multicast_group(). modify_multicast_group() sets up the multicast group address (i.e., mreq.imr_multiaddr) to be joined and the interface address (i.e., mreq.imr_interface) to be used for the multicast join request. The interface address is initialized with the default value, which sets the version of interface address to NSAPI_UNSPEC. This results in LWIP::setsockopt() API to attempt IPv6 multicast join on the IPv4 interface address, hence IPv6 multicast join always fails with the protocol error. Fix: Initialize interface address version based on the multicast address version in LWIP::setsockopt(), before attempting multicast join operation.
1 parent 1798c24 commit 92e56cd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

features/lwipstack/LWIPStack.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,8 @@ nsapi_error_t LWIP::setsockopt(nsapi_socket_t handle, int level, int optname, co
566566
return NSAPI_ERROR_PARAMETER;
567567
}
568568
} else {
569-
ip_addr_set_any(IP_IS_V6(&if_addr), &if_addr);
569+
/* Initialize the interface address type based on the multicast address version */
570+
ip_addr_set_any(IP_IS_V6(&multi_addr), &if_addr);
570571
}
571572

572573
igmp_err = ERR_USE; // Maps to NSAPI_ERROR_UNSUPPORTED

0 commit comments

Comments
 (0)