[ovs-dev] [ext-260 v4 2/2] ofp-errors: New error code ONFBIC_DUP_INSTRUCTION.

Ben Pfaff blp at nicira.com
Mon Jun 24 20:58:44 UTC 2013


This is a prototype of OpenFlow enhancement proposal EXT-260 "Add error
code for duplicate instruction."  It uses the error code proposed there.

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
v3->v4: Fold in change to ofp-actions.at that was (and
incorrectly) in the previous patch in older versions.

 lib/ofp-actions.c    |    4 +---
 lib/ofp-errors.h     |    3 +++
 tests/ofp-actions.at |    4 ++--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
index 5339811..35d0936 100644
--- a/lib/ofp-actions.c
+++ b/lib/ofp-actions.c
@@ -1003,9 +1003,7 @@ decode_openflow11_instructions(const struct ofp11_instruction insts[],
         }
 
         if (out[type]) {
-            return OFPERR_OFPBAC_UNSUPPORTED_ORDER; /* No specific code for
-                                                     * a duplicate instruction
-                                                     * exist */
+            return OFPERR_ONFBIC_DUP_INSTRUCTION;
         }
         out[type] = inst;
     }
diff --git a/lib/ofp-errors.h b/lib/ofp-errors.h
index d144793..17f8bce 100644
--- a/lib/ofp-errors.h
+++ b/lib/ofp-errors.h
@@ -268,6 +268,9 @@ enum ofperr {
     /* OF1.2+(3,8).  Permissions error. */
     OFPERR_OFPBIC_EPERM,
 
+    /* ONF1.1+(2600).  Duplicate instruction. */
+    OFPERR_ONFBIC_DUP_INSTRUCTION,
+
 /* ## --------------- ## */
 /* ## OFPET_BAD_MATCH ## */
 /* ## --------------- ## */
diff --git a/tests/ofp-actions.at b/tests/ofp-actions.at
index b455bb9..ebad040 100644
--- a/tests/ofp-actions.at
+++ b/tests/ofp-actions.at
@@ -339,7 +339,7 @@ dnl Check that an empty Apply-Actions instruction gets dropped.
 0004 0008 00000000
 
 dnl Duplicate instruction type:
-# bad OF1.1 instructions: OFPBAC_UNSUPPORTED_ORDER
+# bad OF1.1 instructions: ONFBIC_DUP_INSTRUCTION
 0004 0008 00000000 0004 0008 00000000
 
 dnl Instructions not multiple of 8 in length.
@@ -381,7 +381,7 @@ dnl Write-Metadata too long.
 0002 0020 00000000 fedcba9876543210 ffffffffffffffff 0000000000000000
 
 dnl Write-Metadata duplicated.
-# bad OF1.1 instructions: OFPBAC_UNSUPPORTED_ORDER
+# bad OF1.1 instructions: ONFBIC_DUP_INSTRUCTION
 0002 0018 00000000 fedcba9876543210 ff00ff00ff00ff00 0002 0018 00000000 fedcba9876543210 ff00ff00ff00ff00
 
 dnl Write-Metadata in wrong position (OpenFlow 1.1+ disregards the order
-- 
1.7.2.5




More information about the dev mailing list