* Find an IPv6 multicast source entry for this imo which matches * the given group index for this socket, and source address. * * XXX TODO: The scope ID, if present in src, is stripped before * any comparison. We SHOULD enforce scope/zone checks where the source * filter entry has a link scope. * * NOTE: This does not check if the entry is in-mode, merely if * it exists, which may not be t
| 290 | * it exists, which may not be the desired behaviour. |
| 291 | */ |
| 292 | static struct in6_msource * |
| 293 | im6o_match_source(struct in6_mfilter *imf, const struct sockaddr *src) |
| 294 | { |
| 295 | struct ip6_msource find; |
| 296 | struct ip6_msource *ims; |
| 297 | const sockunion_t *psa; |
| 298 | |
| 299 | KASSERT(src->sa_family == AF_INET6, ("%s: !AF_INET6", __func__)); |
| 300 | |
| 301 | psa = (const sockunion_t *)src; |
| 302 | find.im6s_addr = psa->sin6.sin6_addr; |
| 303 | in6_clearscope(&find.im6s_addr); /* XXX */ |
| 304 | ims = RB_FIND(ip6_msource_tree, &imf->im6f_sources, &find); |
| 305 | |
| 306 | return ((struct in6_msource *)ims); |
| 307 | } |
| 308 | |
| 309 | /* |
| 310 | * Perform filtering for multicast datagrams on a socket by group and source. |
no test coverage detected