stp: a port without carrier does not become the root port

stp_reselect() took every port with fresh information as a candidate, so a
BPDU credited to a port whose carrier the once-a-second link poll had not
seen yet made that port the root port before the port was set up for it.
A candidate now needs its link bit as well; the poll that sees the carrier
a moment later runs the selection again. Scenario 54.
This commit is contained in:
d00f committed 2026-10-27 22:11:24 +01:00
1 parent b86fd37eaa
commit eb51128ec7
2 files changed
+20 -1

No files matched your search

+1 -1
View File
@@ -660,7 +660,7 @@ static void stp_reselect(void)
continue;
if (!(stp_pflags[stp_j] & STP_PF_ENABLED) || (stp_pflags[stp_j] & STP_PF_ROOTGUARD))
continue;
if (!stp_info_fresh(stp_j))
if (!((stp_link_now >> stp_j) & 1) || !stp_info_fresh(stp_j))
continue;
if (!cmpBytes(stp_dbridge[stp_j].mac, uip_ethaddr.addr, 6))
continue;