Skip to content

Commit 46f9e1d

Browse files
liuhangbingregkh
authored andcommitted
multicast: do not restore deleted record source filter mode to new one
There are two scenarios that we will restore deleted records. The first is when device down and up(or unmap/remap). In this scenario the new filter mode is same with previous one. Because we get it from in_dev->mc_list and we do not touch it during device down and up. The other scenario is when a new socket join a group which was just delete and not finish sending status reports. In this scenario, we should use the current filter mode instead of restore old one. Here are 4 cases in total. old_socket new_socket before_fix after_fix IN(A) IN(A) ALLOW(A) ALLOW(A) IN(A) EX( ) TO_IN( ) TO_EX( ) EX( ) IN(A) TO_EX( ) ALLOW(A) EX( ) EX( ) TO_EX( ) TO_EX( ) Fixes: 24803f3 (igmp: do not remove igmp souce list info when set link down) Fixes: 1666d49 (mld: do not remove mld souce list info when set link down) Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6d5b7d6 commit 46f9e1d

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

‎net/ipv4/igmp.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,8 +1201,7 @@ static void igmpv3_del_delrec(struct in_device *in_dev, struct ip_mc_list *im)
12011201
if (pmc) {
12021202
im->interface = pmc->interface;
12031203
im->crcount = in_dev->mr_qrv ?: net->ipv4.sysctl_igmp_qrv;
1204-
im->sfmode = pmc->sfmode;
1205-
if (pmc->sfmode == MCAST_INCLUDE) {
1204+
if (im->sfmode == MCAST_INCLUDE) {
12061205
im->tomb = pmc->tomb;
12071206
im->sources = pmc->sources;
12081207
for (psf = im->sources; psf; psf = psf->sf_next)

‎net/ipv6/mcast.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,8 +771,7 @@ static void mld_del_delrec(struct inet6_dev *idev, struct ifmcaddr6 *im)
771771
if (pmc) {
772772
im->idev = pmc->idev;
773773
im->mca_crcount = idev->mc_qrv;
774-
im->mca_sfmode = pmc->mca_sfmode;
775-
if (pmc->mca_sfmode == MCAST_INCLUDE) {
774+
if (im->mca_sfmode == MCAST_INCLUDE) {
776775
im->mca_tomb = pmc->mca_tomb;
777776
im->mca_sources = pmc->mca_sources;
778777
for (psf = im->mca_sources; psf; psf = psf->sf_next)

0 commit comments

Comments
 (0)