From 6a774239db02dc82fd2601f146025826a5a93487 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 23 Sep 2008 11:24:30 -0700 Subject: [PATCH] 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. --- secchan/secchan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/secchan/secchan.c b/secchan/secchan.c index 1451cd879..2a200254c 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; -- 2.43.0