--- zzzz-none-000/linux-4.1.52/net/bridge/br_stp_if.c 2018-05-28 02:26:45.000000000 +0000 +++ bcm63-7530ax-731/linux-4.1.52/net/bridge/br_stp_if.c 2022-03-02 11:37:13.000000000 +0000 @@ -19,7 +19,6 @@ #include "br_private.h" #include "br_private_stp.h" - /* Port id is composed of priority and port number. * NB: some bits of priority are dropped to * make room for more ports. @@ -152,6 +151,10 @@ } spin_unlock_bh(&br->lock); +#if defined(CONFIG_BCM_KF_BRIDGE_STP) + /* STP enabled, send notification for all ports */ + br_stp_notify_state_bridge(br); +#endif } static void br_stp_stop(struct net_bridge *br) @@ -171,6 +174,10 @@ } br->stp_enabled = BR_NO_STP; +#if defined(CONFIG_BCM_KF_BRIDGE_STP) + /* STP disabled, send notification for all ports */ + br_stp_notify_state_bridge(br); +#endif } void br_stp_set_enabled(struct net_bridge *br, unsigned long val) @@ -232,6 +239,16 @@ if (br->dev->addr_assign_type == NET_ADDR_SET) return false; +#if defined(CONFIG_BCM_KF_BRIDGE_STP) + /* if the current bridge address is being used by + a member device then keep it */ + list_for_each_entry(p, &br->port_list, list) { + if (0 == memcmp(br->bridge_id.addr, p->dev->dev_addr, ETH_ALEN)) { + return false; + } + } +#endif + list_for_each_entry(p, &br->port_list, list) { if (addr == br_mac_zero || memcmp(p->dev->dev_addr, addr, ETH_ALEN) < 0)