Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds bugfix for lwip multicast group commands #20136

Merged
19 changes: 13 additions & 6 deletions src/inet/UDPEndPointImplLwIP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,13 +431,20 @@ CHIP_ERROR UDPEndPointImplLwIP::IPv4JoinLeaveMulticastGroupImpl(InterfaceId aInt
CHIP_ERROR UDPEndPointImplLwIP::IPv6JoinLeaveMulticastGroupImpl(InterfaceId aInterfaceId, const IPAddress & aAddress, bool join)
{
#ifdef HAVE_IPV6_MULTICAST
const auto method = join ? mld6_joingroup_netif : mld6_leavegroup_netif;

struct netif * const lNetif = FindNetifFromInterfaceId(aInterfaceId);
VerifyOrReturnError(lNetif != nullptr, INET_ERROR_UNKNOWN_INTERFACE);

const ip6_addr_t lIPv6Address = aAddress.ToIPv6();
const err_t lStatus = method(lNetif, &lIPv6Address);
err_t lStatus;
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
if (aInterfaceId.IsPresent())
{
struct netif * const lNetif = FindNetifFromInterfaceId(aInterfaceId);
VerifyOrReturnError(lNetif != nullptr, INET_ERROR_UNKNOWN_INTERFACE);
const auto method = join ? mld6_joingroup_netif : mld6_leavegroup_netif;
lStatus = method(lNetif, &lIPv6Address);
}
else
{
const auto method = join ? mld6_joingroup : mld6_leavegroup;
lStatus = method(IP6_ADDR_ANY6, &lIPv6Address);
}
if (lStatus == ERR_MEM)
{
return CHIP_ERROR_NO_MEMORY;
Expand Down