@@ -417,6 +417,23 @@ static void test_route_mcast_lookup(void)
417417 zassert_equal_ptr (test_mcast_routes [3 ], route ,
418418 "mcast lookup failed" );
419419}
420+
421+ static void test_route_mcast_lookup_by_iface (void )
422+ {
423+ struct net_route_entry_mcast * route =
424+ net_route_mcast_lookup_by_iface (& mcast_prefix_admin , iface_1 );
425+
426+ zassert_not_null (route , "mcast lookup by iface failed" );
427+
428+ route = net_route_mcast_lookup_by_iface (& mcast_prefix_site_local , iface_2 );
429+
430+ zassert_not_null (route , "mcast lookup by iface failed" );
431+
432+ route = net_route_mcast_lookup_by_iface (& mcast_prefix_site_local , iface_1 );
433+
434+ zassert_is_null (route , "mcast lookup by iface should not find a route on this interface" );
435+ }
436+
420437static void test_route_mcast_route_del (void )
421438{
422439 struct net_route_entry_mcast * route ;
@@ -752,6 +769,7 @@ ZTEST(route_mcast_test_suite, test_route_mcast)
752769 test_route_mcast_scenario3 ();
753770 test_route_mcast_multiple_route_ifaces ();
754771 test_route_mcast_lookup ();
772+ test_route_mcast_lookup_by_iface ();
755773 test_route_mcast_route_del ();
756774}
757775ZTEST_SUITE (route_mcast_test_suite , NULL , NULL , NULL , NULL , NULL );
0 commit comments