[mlr] remove unnecessary calls to UpdateMldReport (#7167)

This commit removes incorrect calls to UpdateMldReport.

- UpdateMldReport(MA, true) should be called when a MA is registered,
  thus in MulticastRoutingManager::Add.

- UpdateMldReport(MA, false) should be called when a MA is expired,
  thus in MulticastRoutingManager::Remove.

Note that removing an Multicast Forwarding Cache (MFC) does not mean
the MA is expired. The MFCs can be freely removed even when the MA is
still registered and being renewed.
This commit is contained in:
Simon Lin
2021-11-16 12:24:29 -08:00
committed by GitHub
parent 75a46892ee
commit 1b1a85f2cf
-3
View File
@@ -370,7 +370,6 @@ void MulticastRoutingManager::RemoveInboundMulticastForwardingCache(const Ip6::A
{
if (mfc.IsValid() && mfc.mIif == kMifIndexBackbone && mfc.mGroupAddr == aGroupAddr)
{
UpdateMldReport(mfc.mGroupAddr, false);
RemoveMulticastForwardingCache(mfc);
}
}
@@ -395,7 +394,6 @@ void MulticastRoutingManager::ExpireMulticastForwardingCache(void)
{
if (!UpdateMulticastRouteInfo(mfc))
{
UpdateMldReport(mfc.mGroupAddr, false);
// The multicast route is expired
RemoveMulticastForwardingCache(mfc);
}
@@ -561,7 +559,6 @@ void MulticastRoutingManager::SaveMulticastForwardingCache(const Ip6::Address &
}
else
{
UpdateMldReport(oldest->mGroupAddr, false);
RemoveMulticastForwardingCache(*oldest);
oldest->Set(aSrcAddr, aGroupAddr, aIif, aOif);
}