* Revert socket-layer filter set deltas at t1 to t0 state. */
| 842 | * Revert socket-layer filter set deltas at t1 to t0 state. |
| 843 | */ |
| 844 | static void |
| 845 | imf_rollback(struct in_mfilter *imf) |
| 846 | { |
| 847 | struct ip_msource *ims, *tims; |
| 848 | struct in_msource *lims; |
| 849 | |
| 850 | RB_FOREACH_SAFE(ims, ip_msource_tree, &imf->imf_sources, tims) { |
| 851 | lims = (struct in_msource *)ims; |
| 852 | if (lims->imsl_st[0] == lims->imsl_st[1]) { |
| 853 | /* no change at t1 */ |
| 854 | continue; |
| 855 | } else if (lims->imsl_st[0] != MCAST_UNDEFINED) { |
| 856 | /* revert change to existing source at t1 */ |
| 857 | lims->imsl_st[1] = lims->imsl_st[0]; |
| 858 | } else { |
| 859 | /* revert source added t1 */ |
| 860 | CTR2(KTR_IGMPV3, "%s: free ims %p", __func__, ims); |
| 861 | RB_REMOVE(ip_msource_tree, &imf->imf_sources, ims); |
| 862 | free(ims, M_INMFILTER); |
| 863 | imf->imf_nsrc--; |
| 864 | } |
| 865 | } |
| 866 | imf->imf_st[1] = imf->imf_st[0]; |
| 867 | } |
| 868 | |
| 869 | /* |
| 870 | * Mark socket-layer filter set as INCLUDE {} at t1. |
no test coverage detected