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 <b...@nicira.com> --- lib/ofp-actions.c | 4 +--- lib/ofp-errors.h | 6 ++++++ tests/ofp-actions.at | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index d6fc429..7a0ea87 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -948,9 +948,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_NX_DUP_INSTRUCTION; } out[type] = inst; } diff --git a/lib/ofp-errors.h b/lib/ofp-errors.h index 7da6f6d..3d4894a 100644 --- a/lib/ofp-errors.h +++ b/lib/ofp-errors.h @@ -258,6 +258,9 @@ enum ofperr { /* OF1.2+(3,8). Permissions error. */ OFPERR_OFPBIC_EPERM, + /* NX1.1(3,256), NX1.2+(1). Duplicate instruction. */ + OFPERR_NXBIC_DUP_INSTRUCTION, + /* ## --------------- ## */ /* ## OFPET_BAD_MATCH ## */ /* ## --------------- ## */ @@ -542,6 +545,9 @@ enum ofperr { /* ## ------------------ ## */ /* ## OFPET_EXPERIMENTER ## */ /* ## ------------------ ## */ + + /* NX(1). Duplicate instruction. */ + OFPERR_NX_DUP_INSTRUCTION, }; const char *ofperr_domain_get_name(enum ofp_version); diff --git a/tests/ofp-actions.at b/tests/ofp-actions.at index 8a40eb4..d37c5ce 100644 --- a/tests/ofp-actions.at +++ b/tests/ofp-actions.at @@ -333,7 +333,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: NXBIC_DUP_INSTRUCTION 0004 0008 00000000 0004 0008 00000000 dnl Instructions not multiple of 8 in length. @@ -371,7 +371,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: NXBIC_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 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev