mirror of
https://github.com/espressif/openthread.git
synced 2026-08-28 12:59:54 +00:00
[ip6] only allow external mcast addrs when iface is up (#3504)
This commit is contained in:
@@ -252,11 +252,12 @@ OTAPI const otNetifAddress *OTCALL otIp6GetUnicastAddresses(otInstance *aInstanc
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aAddress A pointer to an IP Address.
|
||||
*
|
||||
* @retval OT_ERROR_NONE Successfully subscribed to the Network Interface Multicast Address.
|
||||
* @retval OT_ERROR_ALREADY The multicast address is already subscribed.
|
||||
* @retval OT_ERROR_INVALID_ARGS The IP Address indicated by @p aAddress is invalid address.
|
||||
* @retval OT_ERROR_NO_BUFS The Network Interface is already storing the maximum allowed external multicast
|
||||
* addresses.
|
||||
* @retval OT_ERROR_NONE Successfully subscribed to the Network Interface Multicast Address.
|
||||
* @retval OT_ERROR_ALREADY The multicast address is already subscribed.
|
||||
* @retval OT_ERROR_INVALID_ARGS The IP Address indicated by @p aAddress is invalid address.
|
||||
* @retval OT_ERROR_INVALID_STATE The Network Interface is not up.
|
||||
* @retval OT_ERROR_NO_BUFS The Network Interface is already storing the maximum allowed external multicast
|
||||
* addresses.
|
||||
*
|
||||
*/
|
||||
otError otIp6SubscribeMulticastAddress(otInstance *aInstance, const otIp6Address *aAddress);
|
||||
|
||||
@@ -334,6 +334,8 @@ otError Netif::SubscribeExternalMulticast(const Address &aAddress)
|
||||
NetifMulticastAddress *entry;
|
||||
size_t num = OT_ARRAY_LENGTH(mExtMulticastAddresses);
|
||||
|
||||
VerifyOrExit(mMulticastAddresses != NULL, error = OT_ERROR_INVALID_STATE);
|
||||
|
||||
if (IsMulticastSubscribed(aAddress))
|
||||
{
|
||||
ExitNow(error = OT_ERROR_ALREADY);
|
||||
|
||||
@@ -367,10 +367,11 @@ public:
|
||||
*
|
||||
* @param[in] aAddress A reference to the multicast address.
|
||||
*
|
||||
* @retval OT_ERROR_NONE Successfully subscribed to @p aAddress.
|
||||
* @retval OT_ERROR_ALREADY The multicast address is already subscribed.
|
||||
* @retval OT_ERROR_INVALID_ARGS The address indicated by @p aAddress is an internal multicast address.
|
||||
* @retval OT_ERROR_NO_BUFS The maximum number of allowed external multicast addresses are already added.
|
||||
* @retval OT_ERROR_NONE Successfully subscribed to @p aAddress.
|
||||
* @retval OT_ERROR_ALREADY The multicast address is already subscribed.
|
||||
* @retval OT_ERROR_INVALID_ARGS The address indicated by @p aAddress is an internal multicast address.
|
||||
* @retval OT_ERROR_INVALID_STATE The Network Interface is not up.
|
||||
* @retval OT_ERROR_NO_BUFS The maximum number of allowed external multicast addresses are already added.
|
||||
*
|
||||
*/
|
||||
otError SubscribeExternalMulticast(const Address &aAddress);
|
||||
|
||||
Reference in New Issue
Block a user