[multicast-routing] don't add MFC entries using mesh local as the source address (#8025)

According to Thread Spec, PBBR should not forward a multicast packet
from Thread interface to Backbone interface when the source address is
Mesh-Local.
This commit is contained in:
whd
2022-08-17 22:59:50 -07:00
committed by GitHub
parent 897a29565e
commit 20aee3fa70
2 changed files with 22 additions and 2 deletions
+1
View File
@@ -309,6 +309,7 @@ otError MulticastRoutingManager::AddMulticastForwardingCache(const Ip6::Address
}
else
{
VerifyOrExit(aSrcAddr.GetPrefix() != AsCoreType(otThreadGetMeshLocalPrefix(gInstance)), error = OT_ERROR_NONE);
// Forward multicast traffic from Thread to Backbone if multicast scope > kRealmLocalScope
// TODO: (MLR) allow scope configuration of outbound multicast routing
if (aGroupAddr.GetScope() > Ip6::Address::kRealmLocalScope)
@@ -143,14 +143,22 @@ class TestMlr(thread_cert.TestCase):
self.collect_ipaddrs()
self.collect_rloc16s()
# ping MA1 from Host could get replied from R1 and R2
# ping MA1 from Host could generate a reply from R1 and R2
self.assertTrue(self.nodes[HOST].ping(MA1, backbone=True, ttl=5))
self.simulator.go(WAIT_REDUNDANCE)
# ping MA2 from R1 could get replied from Host and R2
# ping MA2 from R1 could generate a reply from Host and R2
self.assertTrue(self.nodes[ROUTER1].ping(MA2))
self.simulator.go(WAIT_REDUNDANCE)
# ping MA2 from R1's MLE-ID shouldn't generate a reply from Host or R2
self.assertFalse(self.nodes[ROUTER1].ping(MA2, interface=self.nodes[ROUTER1].get_mleid()))
self.simulator.go(WAIT_REDUNDANCE)
# ping MA2 from R1's LLA shouldn't generate a reply from Host or R2
self.assertFalse(self.nodes[ROUTER1].ping(MA2, interface=self.nodes[ROUTER1].get_linklocal()))
self.simulator.go(WAIT_REDUNDANCE)
def verify(self, pv: PacketVerifier):
pkts = pv.pkts
pv.add_common_vars()
@@ -211,6 +219,17 @@ class TestMlr(thread_cert.TestCase):
pkts.filter_wpan_src64(ROUTER2).filter_ipv6_src_dst(
ROUTER2_DUA, ROUTER1_DUA).filter_ping_reply(identifier=ping_ma2.icmpv6.echo.identifier).must_next()
#
# Verify pinging MA2 from R1's MLE-ID will not be forwarded to the Backbone link
#
# ROUTER1 should send the multicast ping request
ping_ma2_2 = pkts.filter_wpan_src64(ROUTER1).filter_AMPLFMA(mpl_seed_id=ROUTER1_RLOC16).filter_ping_request(
identifier=ping_ma2.icmpv6.echo.identifier + 1).must_next()
# PBBR1 shouldn't forward the multicast ping request to the Backbone link
pkts.filter_eth_src(PBBR1_ETH).filter_ping_request(ping_ma2_2.icmpv6.echo.identifier).must_not_next()
if __name__ == '__main__':
unittest.main()