mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-09-02 15:02:51 +08:00
stp: drop the management failsafe
The window could be armed from the serial console but only ever disarmed by an HTTP request. save_cmd, which gates arming, is cleared only while execute_config() replays the startup config, so every interactive command armed it wherever it was typed, while mgmt_alive, which disarms it, was written in exactly one place, on HTTP traffic. An operator working entirely on the serial console therefore lost STP 180 seconds after enabling it however much they typed, which is what makes the mechanism impossible to test from a console. The documentation described the behaviour that was intended rather than the one that was built, and in both directions: it said a command on the serial console also confirms, and it said a reboot with STP in the startup config disables it again three minutes later. Neither held. The replay path never armed the window at all. Repairing the asymmetry would have kept a mechanism whose premise is contested anyway. A watchdog that switches the protection off in response to silence adds a second failure mode on top of the first: where the network is misconfigured and STP is the thing holding a storm back, restoring forwarding removes the last reason management still answers. Gone with it: the stp failsafe command, the fs and fsT fields of /stp.json, the input and the tripped banner on the Spanning Tree page, the two persistence patterns in config.js, the documentation section, and mgmt_alive itself, which had no other reader. 550 bytes back, 145 of BANK1 and 405 of BANK2, and five of xdata, which is the four counters and mgmt_alive and nothing else. Built for SWTGW218AS and KP_9000_6XHML_X2 on sdcc 4.5.0.
This commit is contained in:
+1
-2
@@ -23,7 +23,6 @@ const conf_cmds = [
|
||||
/^isolate\s+\d{1,2}(\s+(off|\d{1,2}))+$/,
|
||||
/^stp\s+(on|off)$/,
|
||||
/^stp\s+(prio|hello|maxage|fwd|txhold)\s+\d{1,2}$/,
|
||||
/^stp\s+failsafe\s+\d{1,3}$/,
|
||||
/^stp\s+version\s+(rstp|stp)$/,
|
||||
/^stp\s+port\s+\d{1,2}\s+(on|off)$/,
|
||||
/^stp\s+port\s+\d{1,2}\s+edge\s+(on|off|auto)$/,
|
||||
@@ -56,7 +55,7 @@ const conf_overwrite = [
|
||||
/^lag\s+\d+\b/,
|
||||
/^laghash\b/,
|
||||
/^isolate\s+\d{1,2}\b/,
|
||||
/^stp\s+(prio|hello|maxage|fwd|txhold|version|failsafe)\b/,
|
||||
/^stp\s+(prio|hello|maxage|fwd|txhold|version)\b/,
|
||||
/^stp\s+port\s+\d{1,2}\s+(edge|cost|prio|guard|filter|p2p)\b/,
|
||||
/^igmp\b/,
|
||||
/^mtu\s+\d{1,2}\b/,
|
||||
|
||||
+1
-2
@@ -16,7 +16,7 @@
|
||||
<h2>Bridge settings</h2>
|
||||
<table id="stpBridge">
|
||||
<tr>
|
||||
<th>Priority</th><th>Version</th><th>Hello [s]</th><th>Max age [s]</th><th>Fwd delay [s]</th><th>Tx hold</th><th>Mgmt failsafe [s]</th>
|
||||
<th>Priority</th><th>Version</th><th>Hello [s]</th><th>Max age [s]</th><th>Fwd delay [s]</th><th>Tx hold</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><select id="bPrio"></select></td>
|
||||
@@ -25,7 +25,6 @@
|
||||
<td><input id="bMaxage" type="number" min="6" max="40" style="width:4em"></td>
|
||||
<td><input id="bFwd" type="number" min="4" max="30" style="width:4em"></td>
|
||||
<td><input id="bTxhold" type="number" min="1" max="10" style="width:4em"></td>
|
||||
<td><input id="bFailsafe" type="number" min="0" max="255" style="width:4em" title="Auto-disable STP if ports stay blocked while management is silent; 0 = off"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p style="font-size:small">Changes apply immediately. Edge ports skip the listen period; guard/filter act on received BPDUs.</p>
|
||||
|
||||
+1
-6
@@ -99,9 +99,7 @@ function fetchStp() {
|
||||
const s = JSON.parse(xhttp.responseText);
|
||||
if (!stpRows)
|
||||
buildPortsTable(s.ports);
|
||||
document.getElementById("stpStat").textContent = s.fsT
|
||||
? "\u26a0 STP was disabled by the management failsafe (ports were blocked while management was unreachable). Review the topology before re-enabling."
|
||||
: s.on
|
||||
document.getElementById("stpStat").textContent = s.on
|
||||
? (s.weRoot
|
||||
? "This switch (" + bridgeSelf(s) + ") is the root bridge — topology changes: "
|
||||
+ parseInt(s.tc, 16)
|
||||
@@ -133,7 +131,6 @@ function fetchStp() {
|
||||
document.getElementById("bMaxage").value = s.maxage;
|
||||
document.getElementById("bFwd").value = s.fwd;
|
||||
document.getElementById("bTxhold").value = s.txhold;
|
||||
document.getElementById("bFailsafe").value = s.fs;
|
||||
for (const p of s.ports) {
|
||||
document.getElementById("en_" + p.p).value = (p.f & PF_ENABLED) ? "on" : "off";
|
||||
document.getElementById("edge_" + p.p).value =
|
||||
@@ -179,8 +176,6 @@ window.addEventListener("load", function() {
|
||||
.addEventListener("change", e => stpCmd("stp fwd " + e.target.value));
|
||||
document.getElementById("bTxhold")
|
||||
.addEventListener("change", e => stpCmd("stp txhold " + e.target.value));
|
||||
document.getElementById("bFailsafe")
|
||||
.addEventListener("change", e => stpCmd("stp failsafe " + e.target.value));
|
||||
document.getElementById("stpMode")
|
||||
.addEventListener("change", () => { stpDirty = true; });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user