stp: integrate 802.1D Spanning Tree Protocol into BridgeDevice
Adds loop prevention to Ethernet bridges: - BridgeDevice gains stp: Option<StpState> field - enable_stp(priority, mac) method initializes STP per-bridge - BPDU frames (dst 01:80:c2:00:00:00) intercepted in recv(), processed locally, never forwarded - STP hello timer sends periodic BPDUs on all ports (root bridge) - flood() skips STP-blocked ports - build_bpdu() made public for bridge integration - stp module declared in link/mod.rs The recv() flow now: age MACs → check STP hello timer → poll ports → detect BPDU (absorb) → normal frame (learn + forward). Reference: Linux 7.1 net/bridge/br_stp.c, br_stp_bpdu.c, br_stp_timer.c
This commit is contained in:
@@ -5,6 +5,7 @@ pub mod gre;
|
||||
pub mod ipip;
|
||||
pub mod loopback;
|
||||
pub mod qdisc;
|
||||
pub mod stp;
|
||||
pub mod tun;
|
||||
pub mod vlan;
|
||||
pub mod vxlan;
|
||||
|
||||
Reference in New Issue
Block a user