]> git.proxmox.com Git - ovs.git/commitdiff
ofproto: Ignore generation ID for role change to "equal".
authorBen Pfaff <blp@nicira.com>
Mon, 25 May 2015 21:14:05 +0000 (14:14 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 29 Jul 2015 15:04:57 +0000 (08:04 -0700)
The OpenFlow specification says that only role changes to slave or master
check the generation ID, so this is a bug fix.

OpenFlow 1.2 section A.3.9 phrases the requirement this way:

    Additionally, if the role value in the message is OFPCR_ROLE_MASTER
    or OFPCR_ROLE_SLAVE, the switch must validate generation_id to check
    for stale messages.

Found by OFTest.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/ofproto.c

index a7240716e3c9750026ad4fc3b3a863f7b41e3f3e..e9b14720ee34e3c6c803f6e016e896873a16466c 100644 (file)
@@ -5315,7 +5315,8 @@ handle_role_request(struct ofconn *ofconn, const struct ofp_header *oh)
     }
 
     if (request.role != OFPCR12_ROLE_NOCHANGE) {
-        if (request.have_generation_id
+        if (request.role != OFPCR12_ROLE_EQUAL
+            && request.have_generation_id
             && !ofconn_set_master_election_id(ofconn, request.generation_id)) {
                 return OFPERR_OFPRRFC_STALE;
         }