Skip to content

Commit

Permalink
rstp: Properly disable an RSTP port before deleting it.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Tested-by: Daniel Swahn <[email protected]>
  • Loading branch information
Jarno Rajahalme committed Oct 12, 2015
1 parent c7e4f0b commit e73e916
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ofproto/ofproto-dpif.c
Original file line number Diff line number Diff line change
Expand Up @@ -2543,8 +2543,11 @@ set_rstp_port(struct ofport *ofport_,

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;
Expand Down

0 comments on commit e73e916

Please sign in to comment.