From 53fd5c7c6d23f21872afcb041de1520fb9bb8343 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 20 Feb 2014 12:13:26 -0800 Subject: [PATCH] ofproto: Update only OFPUTIL_PS_LINK_DOWN (not STP) from netdev state. When a netdev indicates that its state or configuration has changed, update_port() updates the OpenFlow port to match the changes. However, this was being taken too far: a netdev does not have an STP state, and a state change was resetting the STP state of the port. This fixes the problem. Signed-off-by: Ben Pfaff Reported-by: Vasu Dasari Tested-by: Vasu Dasari --- ofproto/ofproto.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index f69736c78..02e628ae6 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -2236,7 +2236,8 @@ ofport_modified(struct ofport *port, struct ofputil_phy_port *pp) memcpy(port->pp.hw_addr, pp->hw_addr, ETH_ADDR_LEN); port->pp.config = ((port->pp.config & ~OFPUTIL_PC_PORT_DOWN) | (pp->config & OFPUTIL_PC_PORT_DOWN)); - port->pp.state = pp->state; + port->pp.state = ((port->pp.state & ~OFPUTIL_PS_LINK_DOWN) + | (pp->state & OFPUTIL_PS_LINK_DOWN)); port->pp.curr = pp->curr; port->pp.advertised = pp->advertised; port->pp.supported = pp->supported; -- 2.43.0