summaryrefslogtreecommitdiff
path: root/utilities
diff options
context:
space:
mode:
authorJarno Rajahalme <jarno.rajahalme@nsn.com>2013-06-28 19:44:03 +0300
committerBen Pfaff <blp@nicira.com>2013-06-28 10:22:26 -0700
commite3b5693319c461a5909507b9ede57db326c07df2 (patch)
tree274e9cd0feb197a5a0582b556c2580db2629a7fc /utilities
parent340c7bb2b9565b07de7c105d7fae298be908d138 (diff)
downloadopenvswitch-e3b5693319c461a5909507b9ede57db326c07df2.tar.gz
Fix table checking for goto table instruction.
Usually the table id in flow mods is 255, which means that goto table instruction cannot be checked before the table is picked (for flow add), or the rules to be modified are found (flow mod). Move goto table checking from decode (ofp-util) to actions checking (ofp-actions), and postpone the action checking until the table in which the actions are added is known. This fixes OFPBRC_BAD_TABLE_ID errors for flow adds that specify the table id as 255, and have a goto table instruction. Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'utilities')
-rw-r--r--utilities/ovs-ofctl.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index b2470e61e..2d6872ba7 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -2637,9 +2637,15 @@ ofctl_parse_ofp11_instructions(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
/* Convert to ofpacts. */
ofpbuf_init(&ofpacts, 0);
size = of11_in.size;
- error = ofpacts_pull_openflow11_instructions(
- &of11_in, of11_in.size, table_id ? atoi(table_id) : 0,
- &ofpacts);
+ error = ofpacts_pull_openflow11_instructions(&of11_in, of11_in.size,
+ &ofpacts);
+ if (!error) {
+ /* Verify actions. */
+ struct flow flow;
+ memset(&flow, 0, sizeof flow);
+ error = ofpacts_check(ofpacts.data, ofpacts.size, &flow, OFPP_MAX,
+ table_id ? atoi(table_id) : 0);
+ }
if (error) {
printf("bad OF1.1 instructions: %s\n\n", ofperr_get_name(error));
ofpbuf_uninit(&ofpacts);