* Find an IPv4 multicast source entry for this imo which matches * the given group index for this socket, and source address. * * NOTE: This does not check if the entry is in-mode, merely if * it exists, which may not be the desired behaviour. */
| 442 | * it exists, which may not be the desired behaviour. |
| 443 | */ |
| 444 | static struct in_msource * |
| 445 | imo_match_source(struct in_mfilter *imf, const struct sockaddr *src) |
| 446 | { |
| 447 | struct ip_msource find; |
| 448 | struct ip_msource *ims; |
| 449 | const sockunion_t *psa; |
| 450 | |
| 451 | KASSERT(src->sa_family == AF_INET, ("%s: !AF_INET", __func__)); |
| 452 | |
| 453 | /* Source trees are keyed in host byte order. */ |
| 454 | psa = (const sockunion_t *)src; |
| 455 | find.ims_haddr = ntohl(psa->sin.sin_addr.s_addr); |
| 456 | ims = RB_FIND(ip_msource_tree, &imf->imf_sources, &find); |
| 457 | |
| 458 | return ((struct in_msource *)ims); |
| 459 | } |
| 460 | |
| 461 | /* |
| 462 | * Perform filtering for multicast datagrams on a socket by group and source. |
no outgoing calls
no test coverage detected