net: if: Change the iface param in net_if_ipv6_maddr_lookup
Change the handling of iface parameter in net_if_ipv6_maddr_lookup() function: * If the *iface is set to NULL, then return the found interface to the caller. * If the *iface is not NULL, then use that interface when doing the lookup. Change-Id: Ia1f0365170ea9f3e615d189231160614a80d241a Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
253030c654
commit
c3b0f35f6f
2 changed files with 8 additions and 2 deletions
|
@ -607,10 +607,12 @@ struct net_if_mcast_addr *net_if_ipv6_maddr_add(struct net_if *iface,
|
|||
bool net_if_ipv6_maddr_rm(struct net_if *iface, const struct in6_addr *addr);
|
||||
|
||||
/**
|
||||
* @brief Check if this IPv6 multicast address belongs to one of the interfaces.
|
||||
* @brief Check if this IPv6 multicast address belongs to a specific interface
|
||||
* or one of the interfaces.
|
||||
*
|
||||
* @param addr IPv6 address
|
||||
* @param iface Pointer to interface is returned
|
||||
* @param iface If *iface is null, then pointer to interface is returned,
|
||||
* otherwise the *iface value needs to be matched.
|
||||
*
|
||||
* @return Pointer to interface multicast address, NULL if not found.
|
||||
*/
|
||||
|
|
|
@ -554,6 +554,10 @@ struct net_if_mcast_addr *net_if_ipv6_maddr_lookup(const struct in6_addr *maddr,
|
|||
for (iface = __net_if_start; iface != __net_if_end; iface++) {
|
||||
int i;
|
||||
|
||||
if (ret && *ret && iface != *ret) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (i = 0; i < NET_IF_MAX_IPV6_MADDR; i++) {
|
||||
if (!iface->ipv6.mcast[i].is_used ||
|
||||
iface->ipv6.mcast[i].address.family != AF_INET6) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue