* Graft a source entry into an existing socket-layer filter set, * maintaining any required invariants and checking allocations. * * The source is marked as being in the new filter mode at t1. * * Return the pointer to the new node, otherwise return NULL. */
| 758 | * Return the pointer to the new node, otherwise return NULL. |
| 759 | */ |
| 760 | static struct in6_msource * |
| 761 | im6f_graft(struct in6_mfilter *imf, const uint8_t st1, |
| 762 | const struct sockaddr_in6 *psin) |
| 763 | { |
| 764 | struct ip6_msource *nims; |
| 765 | struct in6_msource *lims; |
| 766 | |
| 767 | #ifdef FSTACK |
| 768 | nims = malloc(sizeof(struct ip6_msource), M_IN6MFILTER, |
| 769 | #else |
| 770 | nims = malloc(sizeof(struct in6_msource), M_IN6MFILTER, |
| 771 | #endif |
| 772 | M_NOWAIT | M_ZERO); |
| 773 | if (nims == NULL) |
| 774 | return (NULL); |
| 775 | lims = (struct in6_msource *)nims; |
| 776 | lims->im6s_addr = psin->sin6_addr; |
| 777 | lims->im6sl_st[0] = MCAST_UNDEFINED; |
| 778 | lims->im6sl_st[1] = st1; |
| 779 | RB_INSERT(ip6_msource_tree, &imf->im6f_sources, nims); |
| 780 | ++imf->im6f_nsrc; |
| 781 | |
| 782 | return (lims); |
| 783 | } |
| 784 | |
| 785 | /* |
| 786 | * Prune a source entry from an existing socket-layer filter set, |
no test coverage detected