[ovs-dev] [PATCH 2/3] connmgr: Demote service controllers too in ofconn_set_role().

Ben Pfaff blp at nicira.com
Tue Jul 22 22:58:24 UTC 2014


Service controllers can set their roles, so it's necessary to demote them
to slaves if another controller becomes master.  Unfortunately the
'controllers' hmap only contains primary controllers, so this was omitted.

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 ofproto/connmgr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c
index 80b0f6d..be99529 100644
--- a/ofproto/connmgr.c
+++ b/ofproto/connmgr.c
@@ -932,7 +932,7 @@ ofconn_set_role(struct ofconn *ofconn, enum ofp12_controller_role role)
     if (role != ofconn->role && role == OFPCR12_ROLE_MASTER) {
         struct ofconn *other;
 
-        HMAP_FOR_EACH (other, hmap_node, &ofconn->connmgr->controllers) {
+        LIST_FOR_EACH (other, node, &ofconn->connmgr->all_conns) {
             if (other->role == OFPCR12_ROLE_MASTER) {
                 other->role = OFPCR12_ROLE_SLAVE;
                 ofconn_send_role_status(other, OFPCR12_ROLE_SLAVE, OFPCRR_MASTER_REQUEST);
-- 
1.7.10.4




More information about the dev mailing list