netstack3_ip::multicast_forwarding

Type Alias MulticastRouteTargets

Source
pub type MulticastRouteTargets<D> = Arc<[MulticastRouteTarget<D>]>;
Expand description

The collection of targets out of which to forward a multicast packet.

Note, storing the targets behind an Arc allows us to return a reference to the targets, to contexts that are not protected by the multicast route table lock, without cloning the underlying data. Here, an Arc<Mutex<...>> is unnecessary, because the underlying targets list is never modified. This is not to say that a route’s targets are never modified (e.g. device removal prunes the list of targets); in such cases the route’s target list is replaced with a new allocation. This strategy allows us to avoid additional locking on the hot path, at the cost of extra allocations for certain control operations.

Aliased Type§

struct MulticastRouteTargets<D> { /* private fields */ }