From 3e212bdbbbac8fa9d552b5826436c57ca67ef35a Mon Sep 17 00:00:00 2001
From: Jarno Rajahalme <jrajahalme@nicira.com>
Date: Tue, 29 Sep 2015 13:38:28 -0700
Subject: [PATCH] rstp: Properly disable an RSTP port before deleting it.
Cc: <jrajahalme@nicira.com>

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
---
 ofproto/ofproto-dpif.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index ef1ad18..2ac8c92 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -2538,8 +2538,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;
-- 
2.1.4

