From 1b1a85f2cf42fc4843296fa3260eb491bb65b696 Mon Sep 17 00:00:00 2001 From: Simon Lin Date: Wed, 17 Nov 2021 04:24:29 +0800 Subject: [PATCH] [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. --- src/posix/platform/multicast_routing.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/posix/platform/multicast_routing.cpp b/src/posix/platform/multicast_routing.cpp index 8759e3c2e..e637ddb69 100644 --- a/src/posix/platform/multicast_routing.cpp +++ b/src/posix/platform/multicast_routing.cpp @@ -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); }