File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -957,6 +957,30 @@ net_route_mcast_lookup(struct in6_addr *group)
957957
958958 return NULL ;
959959}
960+
961+ struct net_route_entry_mcast *
962+ net_route_mcast_lookup_by_iface (struct in6_addr * group , struct net_if * iface )
963+ {
964+ ARRAY_FOR_EACH_PTR (route_mcast_entries , route ) {
965+ if (!route -> is_used ) {
966+ continue ;
967+ }
968+
969+ ARRAY_FOR_EACH (route -> ifaces , i ) {
970+ if (!route -> ifaces [i ] || route -> ifaces [i ] != iface ) {
971+ continue ;
972+ }
973+
974+ if (net_ipv6_is_prefix (group -> s6_addr ,
975+ route -> group .s6_addr ,
976+ route -> prefix_len )) {
977+ return route ;
978+ }
979+ }
980+ }
981+
982+ return NULL ;
983+ }
960984#endif /* CONFIG_NET_ROUTE_MCAST */
961985
962986bool net_route_get_info (struct net_if * iface ,
Original file line number Diff line number Diff line change @@ -272,6 +272,17 @@ bool net_route_mcast_del(struct net_route_entry_mcast *route);
272272struct net_route_entry_mcast *
273273net_route_mcast_lookup (struct in6_addr * group );
274274
275+ /**
276+ * @brief Lookup a multicast routing entry on a given interface.
277+ *
278+ * @param group IPv6 multicast group address
279+ * @param iface Network interface to check
280+ *
281+ * @return Routing entry corresponding to this multicast group and interface.
282+ */
283+ struct net_route_entry_mcast *
284+ net_route_mcast_lookup_by_iface (struct in6_addr * group , struct net_if * iface );
285+
275286/**
276287 * @brief Add an interface to multicast routing entry.
277288 *
You can’t perform that action at this time.
0 commit comments