From 49581ff4eb5248c0a49d65684729fd4fb4a985dd Mon Sep 17 00:00:00 2001 From: Glen Gibb Date: Wed, 24 Feb 2010 16:13:17 -0800 Subject: [PATCH] secchan: Fix port status detection secchan was reporting the *opposite* port status for port down/link down. Bug reported by: Takayuki Hama --- secchan/port-watcher.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/secchan/port-watcher.c b/secchan/port-watcher.c index 1d8d69d..0998e16 100644 --- a/secchan/port-watcher.c +++ b/secchan/port-watcher.c @@ -384,8 +384,8 @@ port_watcher_periodic_cb(void *pw_) } new_opp = *opp; - set_bit(htonl(OFPPC_PORT_DOWN), flags & NETDEV_UP, &new_opp.config); - set_bit(htonl(OFPPS_LINK_DOWN), flags & NETDEV_CARRIER, + set_bit(htonl(OFPPC_PORT_DOWN), ~flags & NETDEV_UP, &new_opp.config); + set_bit(htonl(OFPPS_LINK_DOWN), ~flags & NETDEV_CARRIER, &new_opp.state); if (opp->config != new_opp.config || opp->state != new_opp.state) { struct ofp_port_status *ops;