RSTP may end up referencing stale memory if a port is removed without
disabling it first.
This patch, together with the previous patch by Daniele Venturino, was
tested to resolve a crach by Daniel Swahn.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Tested-by: Daniel Swahn <daniel.swahn@clavister.com>
if (!s || !s->enable) {
if (rp) {
- rstp_port_unref(rp);
+ rstp_port_set_aux(rp, NULL);
+ rstp_port_set_state(rp, RSTP_DISABLED);
+ rstp_port_set_mac_operational(rp, false);
ofport->rstp_port = NULL;
+ rstp_port_unref(rp);
update_rstp_port_state(ofport);
}
return;