* 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
| 451 | * should be suppressed, or non-zero if reports should be issued. |
| 452 | */ |
| 453 | static __inline int |
| 454 | mld_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. |
no test coverage detected