stp: apply an edge-port change immediately

"stp port N edge off" cleared only the admin and auto flags, not the
operational one - and that is the flag the engine actually consults: it
exempts the port from topology changes and lets it skip the listen
period. A port therefore stayed an edge port until the next "stp off" /
"stp on", silently ignoring the new setting. Clear it with the others,
and mark an admin edge operational right away, as stp_setup() does.
This commit is contained in:
d00f
2026-08-18 23:28:33 +02:00
committed by d00f
parent 3c4fb679bd
commit 6b4d2b9cfa
+6 -2
View File
@@ -675,9 +675,13 @@ void stp_parse(void) __banked __reentrant
if (stpEnabled) if (stpEnabled)
stp_state_set(port, 0b11); /* plain forwarding */ stp_state_set(port, 0b11); /* plain forwarding */
} else if (cmd_compare(3, "edge")) { } else if (cmd_compare(3, "edge")) {
stp_pflags[port] &= ~(STP_PF_ADMEDGE | STP_PF_AUTOEDGE); /* Also drop the *operational* edge flag: it is what exempts the
* port from topology changes and lets it skip the listen period,
* so leaving it set would keep the old behaviour until the next
* "stp off"/"stp on". An admin edge is operational immediately. */
stp_pflags[port] &= ~(STP_PF_ADMEDGE | STP_PF_AUTOEDGE | STP_PF_OPEREDGE);
if (cmd_compare(4, "on")) if (cmd_compare(4, "on"))
stp_pflags[port] |= STP_PF_ADMEDGE; stp_pflags[port] |= STP_PF_ADMEDGE | STP_PF_OPEREDGE;
else if (cmd_compare(4, "auto")) else if (cmd_compare(4, "auto"))
stp_pflags[port] |= STP_PF_AUTOEDGE; stp_pflags[port] |= STP_PF_AUTOEDGE;
else if (!cmd_compare(4, "off")) else if (!cmd_compare(4, "off"))