mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-09-02 15:02:51 +08:00
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:
+6
-2
@@ -675,9 +675,13 @@ void stp_parse(void) __banked __reentrant
|
||||
if (stpEnabled)
|
||||
stp_state_set(port, 0b11); /* plain forwarding */
|
||||
} 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"))
|
||||
stp_pflags[port] |= STP_PF_ADMEDGE;
|
||||
stp_pflags[port] |= STP_PF_ADMEDGE | STP_PF_OPEREDGE;
|
||||
else if (cmd_compare(4, "auto"))
|
||||
stp_pflags[port] |= STP_PF_AUTOEDGE;
|
||||
else if (!cmd_compare(4, "off"))
|
||||
|
||||
Reference in New Issue
Block a user