From: Ben Pfaff Date: Tue, 23 Sep 2008 18:24:30 +0000 (-0700) Subject: stp: Turn off STP on ports that are disabled or have no link. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a774239db02dc82fd2601f146025826a5a93487;p=openvswitch stp: Turn off STP on ports that are disabled or have no link. Fixes a problem that a port that is disabled via "ifconfig down" does not come back up properly when it is brought back up again with "ifconfig up", if STP is enabled. --- diff --git a/secchan/secchan.c b/secchan/secchan.c index 1451cd87..2a200254 100644 --- a/secchan/secchan.c +++ b/secchan/secchan.c @@ -1155,7 +1155,8 @@ stp_port_changed_cb(uint16_t port_no, p = stp_get_port(stp->stp, port_no); if (new->port_no == htons(OFPP_NONE) - || new->config & htonl(OFPPC_NO_STP)) { + || new->config & htonl(OFPPC_NO_STP | OFPPC_PORT_DOWN) + || new->state & htonl(OFPPS_LINK_DOWN)) { stp_port_disable(p); } else { int speed = 0;