MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mld_is_addr_reported

Function mld_is_addr_reported

freebsd/netinet6/mld6.c:453–470  ·  view source on GitHub ↗

* Filter outgoing MLD report state by group. * * Reports are ALWAYS suppressed for ALL-HOSTS (ff02::1) * and node-local addresses. However, kernel and socket consumers * always embed the KAME scope ID in the address provided, so strip it * when performing comparison. * Note: This is not the same as the *multicast* scope. * * Return zero if the given group is one for which MLD reports * sh

Source from the content-addressed store, hash-verified

451 * should be suppressed, or non-zero if reports should be issued.
452 */
453static __inline int
454mld_is_addr_reported(const struct in6_addr *addr)
455{
456
457 KASSERT(IN6_IS_ADDR_MULTICAST(addr), ("%s: not multicast", __func__));
458
459 if (IPV6_ADDR_MC_SCOPE(addr) == IPV6_ADDR_SCOPE_NODELOCAL)
460 return (0);
461
462 if (IPV6_ADDR_MC_SCOPE(addr) == IPV6_ADDR_SCOPE_LINKLOCAL) {
463 struct in6_addr tmp = *addr;
464 in6_clearscope(&tmp);
465 if (IN6_ARE_ADDR_EQUAL(&tmp, &in6addr_linklocal_allnodes))
466 return (0);
467 }
468
469 return (1);
470}
471
472/*
473 * Attach MLD when PF_INET6 is attached to an interface.

Callers 2

mld_initial_joinFunction · 0.85
mld_handle_state_changeFunction · 0.85

Calls 1

in6_clearscopeFunction · 0.85

Tested by

no test coverage detected