ofp-errors: Use OFPERR_OFPBRC_IS_SLAVE to reject slave controllers.
authorBen Pfaff <blp@nicira.com>
Thu, 22 Jan 2015 17:07:46 +0000 (09:07 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 22 Jan 2015 17:08:27 +0000 (09:08 -0800)
This error code was just overlooked before.

Reported-by: Anup Khadka <khadka.py@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
lib/ofp-errors.h
ofproto/ofproto.c

index a4d4c5c..aff2075 100644 (file)
@@ -106,6 +106,12 @@ enum ofperr {
     /* Expected: 0x0,3,5 in OF1.1 means both OFPBIC_BAD_EXPERIMENTER and
      * OFPBIC_BAD_EXP_TYPE. */
 
+    /* Expected: 0x0,1,5 in OF1.0 means both OFPBRC_EPERM and
+     * OFPBRC_IS_SLAVE. */
+
+    /* Expected: 0x0,1,5 in OF1.1 means both OFPBRC_EPERM and
+     * OFPBRC_IS_SLAVE. */
+
 /* ## ------------------ ## */
 /* ## OFPET_HELLO_FAILED ## */
 /* ## ------------------ ## */
@@ -154,7 +160,7 @@ enum ofperr {
      *   code defined the specification. ] */
     OFPERR_OFPBRC_BAD_TABLE_ID,
 
-    /* OF1.2+(1,10).  Denied because controller is slave. */
+    /* OF1.0-1.1(1,5), OF1.2+(1,10).  Denied because controller is slave. */
     OFPERR_OFPBRC_IS_SLAVE,
 
     /* NX1.0-1.1(1,514), OF1.2+(1,11).  Invalid port.  [ A non-standard error
index ba4263e..b3909ad 100644 (file)
@@ -3110,7 +3110,7 @@ reject_slave_controller(struct ofconn *ofconn)
 {
     if (ofconn_get_type(ofconn) == OFCONN_PRIMARY
         && ofconn_get_role(ofconn) == OFPCR12_ROLE_SLAVE) {
-        return OFPERR_OFPBRC_EPERM;
+        return OFPERR_OFPBRC_IS_SLAVE;
     } else {
         return 0;
     }