mirror of
https://github.com/espressif/openthread.git
synced 2026-08-06 18:57:47 +00:00
[cli] support 1 or more mcast addresses for ipmaddr add command (#7253)
Because the 2 addresses are registered sequentially from the same method call, the OpenThread stack will not have had the opportunity to send out MLR.req with a single address. So this should result in sending out one MLR.req with two addresses inside, if 2 addresses are provided. Without changes in the APIs.
This commit is contained in:
+10
-2
@@ -2132,12 +2132,20 @@ exit:
|
||||
|
||||
otError Interpreter::ProcessIpMulticastAddrAdd(Arg aArgs[])
|
||||
{
|
||||
otError error;
|
||||
otIp6Address address;
|
||||
|
||||
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
|
||||
otError error = OT_ERROR_INVALID_ARGS;
|
||||
for (Arg *arg = &aArgs[0]; !arg->IsEmpty(); arg++)
|
||||
{
|
||||
SuccessOrExit(error = arg->ParseAsIp6Address(address));
|
||||
SuccessOrExit(error = otIp6SubscribeMulticastAddress(GetInstancePtr(), &address));
|
||||
}
|
||||
#else
|
||||
otError error;
|
||||
SuccessOrExit(error = aArgs[0].ParseAsIp6Address(address));
|
||||
error = otIp6SubscribeMulticastAddress(GetInstancePtr(), &address);
|
||||
|
||||
#endif
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user