Merge "igmp: Add ip_mc_list lock in ip_check_mc_rcu"

This commit is contained in:
qctecmdr
2022-06-29 05:26:51 -07:00
committed by Gerrit - the friendly Code Review server

View File

@@ -2735,6 +2735,7 @@ int ip_check_mc_rcu(struct in_device *in_dev, __be32 mc_addr, __be32 src_addr, u
rv = 1; rv = 1;
} else if (im) { } else if (im) {
if (src_addr) { if (src_addr) {
spin_lock_bh(&im->lock);
for (psf = im->sources; psf; psf = psf->sf_next) { for (psf = im->sources; psf; psf = psf->sf_next) {
if (psf->sf_inaddr == src_addr) if (psf->sf_inaddr == src_addr)
break; break;
@@ -2745,6 +2746,7 @@ int ip_check_mc_rcu(struct in_device *in_dev, __be32 mc_addr, __be32 src_addr, u
im->sfcount[MCAST_EXCLUDE]; im->sfcount[MCAST_EXCLUDE];
else else
rv = im->sfcount[MCAST_EXCLUDE] != 0; rv = im->sfcount[MCAST_EXCLUDE] != 0;
spin_unlock_bh(&im->lock);
} else } else
rv = 1; /* unspecified source; tentatively allow */ rv = 1; /* unspecified source; tentatively allow */
} }