net/bridge/br_multicast_eht.c
Source file repositories/reference/linux-study-clean/net/bridge/br_multicast_eht.c
File Facts
- System
- Linux kernel
- Corpus path
net/bridge/br_multicast_eht.c- Extension
.c- Size
- 22518 bytes
- Lines
- 823
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/err.hlinux/export.hlinux/if_ether.hlinux/igmp.hlinux/in.hlinux/jhash.hlinux/kernel.hlinux/log2.hlinux/netdevice.hlinux/netfilter_bridge.hlinux/random.hlinux/rculist.hlinux/skbuff.hlinux/slab.hlinux/timer.hlinux/inetdevice.hlinux/mroute.hnet/ip.hnet/switchdev.hlinux/icmpv6.hnet/ipv6.hnet/mld.hnet/ip6_checksum.hnet/addrconf.hbr_private.hbr_private_mcast_eht.h
Detected Declarations
function br_multicast_eht_host_lookupfunction br_multicast_eht_host_filter_modefunction br_multicast_eht_set_entry_lookupfunction br_multicast_eht_set_lookupfunction __eht_destroy_hostfunction br_multicast_destroy_eht_set_entryfunction br_multicast_destroy_eht_setfunction __eht_del_set_entryfunction br_multicast_del_eht_setfunction br_multicast_eht_clean_setsfunction br_multicast_eht_set_entry_expiredfunction br_multicast_eht_set_expiredfunction __eht_lookup_create_hostfunction __eht_lookup_create_set_entryfunction __eht_lookup_create_setfunction br_multicast_ip_src_to_eht_addrfunction br_eht_convert_host_filter_modefunction br_multicast_create_eht_set_entryfunction br_multicast_del_eht_set_entryfunction br_multicast_del_eht_hostfunction __eht_create_set_entriesfunction __eht_del_set_entriesfunction br_multicast_eht_allowfunction br_multicast_eht_blockfunction __eht_inc_excfunction hlist_for_each_entry_safefunction br_multicast_eht_incfunction br_multicast_eht_excfunction __eht_ip4_handlefunction __eht_ip6_handlefunction br_multicast_eht_handlefunction br_multicast_eht_set_hosts_limit
Annotated Snippet
hlist_for_each_entry_safe(src_ent, tmp, &pg->src_list, node) {
br_multicast_ip_src_to_eht_addr(&src_ent->addr,
&eht_src_addr);
if (!br_multicast_eht_set_lookup(pg, &eht_src_addr)) {
br_multicast_del_group_src(src_ent, true);
changed = true;
continue;
}
/* this is an optimization for TO_INCLUDE where we lower
* the set's timeout to LMQT to catch timeout hosts:
* - host A (timing out): set entries X, Y
* - host B: set entry Z (new from current TO_INCLUDE)
* sends BLOCK Z after LMQT but host A's EHT
* entries still exist (unless lowered to LMQT
* so they can timeout with the S,Gs)
* => we wait another LMQT, when we can just delete the
* group immediately
*/
if (!(src_ent->flags & BR_SGRP_F_SEND) ||
filter_mode != MCAST_INCLUDE ||
!to_report)
continue;
eht_set = br_multicast_eht_set_lookup(pg,
&eht_src_addr);
if (!eht_set)
continue;
mod_timer(&eht_set->timer, jiffies + br_multicast_lmqt(brmctx));
}
}
return changed;
}
static bool br_multicast_eht_inc(const struct net_bridge_mcast *brmctx,
struct net_bridge_port_group *pg,
union net_bridge_eht_addr *h_addr,
void *srcs,
u32 nsrcs,
size_t addr_size,
bool to_report)
{
bool changed;
changed = __eht_inc_exc(brmctx, pg, h_addr, srcs, nsrcs, addr_size,
MCAST_INCLUDE, to_report);
br_eht_convert_host_filter_mode(brmctx, pg, h_addr, MCAST_INCLUDE);
return changed;
}
static bool br_multicast_eht_exc(const struct net_bridge_mcast *brmctx,
struct net_bridge_port_group *pg,
union net_bridge_eht_addr *h_addr,
void *srcs,
u32 nsrcs,
size_t addr_size,
bool to_report)
{
bool changed;
changed = __eht_inc_exc(brmctx, pg, h_addr, srcs, nsrcs, addr_size,
MCAST_EXCLUDE, to_report);
br_eht_convert_host_filter_mode(brmctx, pg, h_addr, MCAST_EXCLUDE);
return changed;
}
static bool __eht_ip4_handle(const struct net_bridge_mcast *brmctx,
struct net_bridge_port_group *pg,
union net_bridge_eht_addr *h_addr,
void *srcs,
u32 nsrcs,
int grec_type)
{
bool changed = false, to_report = false;
switch (grec_type) {
case IGMPV3_ALLOW_NEW_SOURCES:
br_multicast_eht_allow(brmctx, pg, h_addr, srcs, nsrcs,
sizeof(__be32));
break;
case IGMPV3_BLOCK_OLD_SOURCES:
changed = br_multicast_eht_block(brmctx, pg, h_addr, srcs, nsrcs,
sizeof(__be32));
break;
case IGMPV3_CHANGE_TO_INCLUDE:
to_report = true;
fallthrough;
case IGMPV3_MODE_IS_INCLUDE:
changed = br_multicast_eht_inc(brmctx, pg, h_addr, srcs, nsrcs,
Annotation
- Immediate include surface: `linux/err.h`, `linux/export.h`, `linux/if_ether.h`, `linux/igmp.h`, `linux/in.h`, `linux/jhash.h`, `linux/kernel.h`, `linux/log2.h`.
- Detected declarations: `function br_multicast_eht_host_lookup`, `function br_multicast_eht_host_filter_mode`, `function br_multicast_eht_set_entry_lookup`, `function br_multicast_eht_set_lookup`, `function __eht_destroy_host`, `function br_multicast_destroy_eht_set_entry`, `function br_multicast_destroy_eht_set`, `function __eht_del_set_entry`, `function br_multicast_del_eht_set`, `function br_multicast_eht_clean_sets`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.