From: Ethan Jackson Date: Sun, 19 Feb 2012 08:34:28 +0000 (-0800) Subject: ofproto-dpif: Cleanup STP on ports when disabled on their bridge. X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=1833352c33fb73077b60e618940ad094c426a4cc;p=sliver-openvswitch.git ofproto-dpif: Cleanup STP on ports when disabled on their bridge. When STP is enabled on a bridge, the STP module puts its ports in an STP_LISTENING state until STP converges. This causes all traffic destined for these ports to be dropped. If STP is disabled on the bridge, but not explicitly disabled on its ports, the bridge fails to remove the STP state from these ports. Therefore, if a port is in an STP_LISTENING state, it will remain in that state and continue to drop all traffic indefinitely. This patch fixes the issue. Signed-off-by: Ethan Jackson Bug #9157. --- diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index f1d42a2e1..9a4d6b264 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -163,6 +163,8 @@ static void bundle_wait(struct ofbundle *); static void stp_run(struct ofproto_dpif *ofproto); static void stp_wait(struct ofproto_dpif *ofproto); +static int set_stp_port(struct ofport *, + const struct ofproto_port_stp_settings *); struct action_xlate_ctx { /* action_xlate_ctx_init() initializes these members. */ @@ -989,6 +991,12 @@ set_stp(struct ofproto *ofproto_, const struct ofproto_stp_settings *s) stp_set_max_age(ofproto->stp, s->max_age); stp_set_forward_delay(ofproto->stp, s->fwd_delay); } else { + struct ofport *ofport; + + HMAP_FOR_EACH (ofport, hmap_node, &ofproto->up.ports) { + set_stp_port(ofport, NULL); + } + stp_destroy(ofproto->stp); ofproto->stp = NULL; }