Date: Mon, 12 Oct 2020 13:11:48 -0400 From: Dheeraj Kandula <dkandula@gmail.com> To: freebsd-net@freebsd.org Subject: ims_merge in in_mcast.c Message-ID: <CA%2BqNgxTMpE9_iT=ZoC78qMEeJPvZMKuG024k8rU2uaL3eKb1sQ@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
974 /* 975 * Merge socket-layer source into IGMP-layer source. 976 * If rollback is non-zero, perform the inverse of the merge. 977 */ 978 static void 979 ims_merge(struct ip_msource *ims, const struct in_msource *lims, 980 const int rollback) 981 { 982 int n = rollback ? -1 : 1; 983 984 if (lims->imsl_st[0] == MCAST_EXCLUDE) { 985 CTR3(KTR_IGMPV3, "%s: t1 ex -= %d on 0x%08x", 986 __func__, n, ims->ims_haddr); 987 ims->ims_st[1].ex -= n; 988 } else if (lims->imsl_st[0] == MCAST_INCLUDE) { 989 CTR3(KTR_IGMPV3, "%s: t1 in -= %d on 0x%08x", 990 __func__, n, ims->ims_haddr); 991 ims->ims_st[1].in -= n; 992 } 993 994 if (lims->imsl_st[1] == MCAST_EXCLUDE) { 995 CTR3(KTR_IGMPV3, "%s: t1 ex += %d on 0x%08x", 996 __func__, n, ims->ims_haddr); 997 ims->ims_st[1].ex += n; 998 } else if (lims->imsl_st[1] == MCAST_INCLUDE) { 999 CTR3(KTR_IGMPV3, "%s: t1 in += %d on 0x%08x", 1000 __func__, n, ims->ims_haddr); 1001 ims->ims_st[1].in += n; 1002 } 1003 } On line 987 and 991 shouldn't the index be 0 instead of 1. i.e. ims->ims_st[0].ex -= n; and ims->ims_st[0].in -= n; On a rollback, the entry at index 0 is incremented and the entry at index 1 is decremented. On a non-rollback merge, the entry at index 0 is decremented and the entry at index 1 is incremented. Dheeraj
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BqNgxTMpE9_iT=ZoC78qMEeJPvZMKuG024k8rU2uaL3eKb1sQ>