From 825bce7473d9282cdf2f08d09584d3edcd7526ed Mon Sep 17 00:00:00 2001 From: Selvamuthukumar Date: Wed, 24 Sep 2014 09:53:13 -0700 Subject: [PATCH] ofp-actions: Fix error code for invalid table id. Send OFPET_BAD_INSTRUCTION/OFPBIC_BAD_TABLE_ID if table is invalid in goto table instruction. Signed-off-by: Selvamuthukumar Signed-off-by: Ben Pfaff --- lib/ofp-actions.c | 2 +- tests/ofp-actions.at | 2 +- tests/ofproto.at | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index cc1f9a02f..ea47ff943 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -2125,7 +2125,7 @@ ofpact_check__(enum ofputil_protocol *usable_protocols, struct ofpact *a, uint8_t goto_table = ofpact_get_GOTO_TABLE(a)->table_id; if ((table_id != 255 && goto_table <= table_id) || (n_tables != 255 && goto_table >= n_tables)) { - return OFPERR_OFPBRC_BAD_TABLE_ID; + return OFPERR_OFPBIC_BAD_TABLE_ID; } return 0; } diff --git a/tests/ofp-actions.at b/tests/ofp-actions.at index 452bdbfe2..c82133c1c 100644 --- a/tests/ofp-actions.at +++ b/tests/ofp-actions.at @@ -357,7 +357,7 @@ dnl Goto-Table 1 instruction non-zero padding 0001 0008 01 000001 dnl Goto-Table 1 instruction go back to the previous table. -# bad OF1.1 instructions: OFPBRC_BAD_TABLE_ID +# bad OF1.1 instructions: OFPBIC_BAD_TABLE_ID 2,0001 0008 01 000000 dnl Goto-Table 1 diff --git a/tests/ofproto.at b/tests/ofproto.at index f14cbcc44..83effeb57 100644 --- a/tests/ofproto.at +++ b/tests/ofproto.at @@ -600,7 +600,7 @@ AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:2]) # but at least it's the same code in ofpacts_check() that issues the error. AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:1], [1], [], - [ovs-ofctl: actions are invalid with specified match (OFPBRC_BAD_TABLE_ID) + [ovs-ofctl: actions are invalid with specified match (OFPBIC_BAD_TABLE_ID) ]) OVS_VSWITCHD_STOP AT_CLEANUP -- 2.20.1