Jean Tourrilhes jt@hpl.hp.com
Jeremy Stribling strib@nicira.com
Jesse Gross jesse@nicira.com
+Jing Ai jinga@google.com
Joe Perches joe@perches.com
Joe Stringer joe@wand.net.nz
Jun Nakajima jun.nakajima@intel.com
Jed Daniels openvswitch@jeddaniels.com
Jeff Merrick jmerrick@vmware.com
Jeongkeun Lee jklee@hp.com
-Jing Ai ai_jing2000@hotmail.com
Joan Cirer joan@ev0.net
John Galgay john@galgay.net
Kevin Mancuso kevin.mancuso@rackspace.com
enum ofperr
ofpacts_pull_openflow11_instructions(struct ofpbuf *openflow,
unsigned int instructions_len,
+ uint8_t table_id,
struct ofpbuf *ofpacts)
{
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
oigt = instruction_get_OFPIT11_GOTO_TABLE(
insts[OVSINST_OFPIT11_GOTO_TABLE]);
+ if (table_id >= oigt->table_id) {
+ error = OFPERR_OFPBRC_BAD_TABLE_ID;
+ goto exit;
+ }
ogt = ofpact_put_GOTO_TABLE(ofpacts);
ogt->table_id = oigt->table_id;
}
struct ofpbuf *ofpacts);
enum ofperr ofpacts_pull_openflow11_instructions(struct ofpbuf *openflow,
unsigned int instructions_len,
+ uint8_t table_id,
struct ofpbuf *ofpacts);
enum ofperr ofpacts_check(const struct ofpact[], size_t ofpacts_len,
const struct flow *, int max_ports);
return error;
}
- error = ofpacts_pull_openflow11_instructions(&b, b.size, ofpacts);
+ error = ofpacts_pull_openflow11_instructions(&b, b.size, ofm->table_id,
+ ofpacts);
if (error) {
return error;
}
}
if (ofpacts_pull_openflow11_instructions(msg, length - sizeof *ofs -
- padded_match_len, ofpacts)) {
+ padded_match_len,
+ ofs->table_id, ofpacts)) {
VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST_FLOW reply bad instructions");
return EINVAL;
}
# 7: 01 -> 00
0001 0008 01 000001
+dnl Goto-Table 1 instruction go back to the previous table.
+# bad OF1.1 instructions: OFPBRC_BAD_TABLE_ID
+2,0001 0008 01 000000
+
dnl Goto-Table 1
# actions=goto_table:1
0001 0008 01 000000
enum ofperr error;
size_t size;
struct ds s;
+ const char *table_id;
+ char *instructions;
+
+ /* Parse table_id separated with the follow-up instructions by ",", if
+ * any. */
+ instructions = ds_cstr(&in);
+ table_id = NULL;
+ if (strstr(instructions, ",")) {
+ table_id = strsep(&instructions, ",");
+ }
/* Parse hex bytes. */
ofpbuf_init(&of11_in, 0);
- if (ofpbuf_put_hex(&of11_in, ds_cstr(&in), NULL)[0] != '\0') {
+ if (ofpbuf_put_hex(&of11_in, instructions, NULL)[0] != '\0') {
ovs_fatal(0, "Trailing garbage in hex data");
}
/* Convert to ofpacts. */
ofpbuf_init(&ofpacts, 0);
size = of11_in.size;
- error = ofpacts_pull_openflow11_instructions(&of11_in, of11_in.size,
- &ofpacts);
+ error = ofpacts_pull_openflow11_instructions(
+ &of11_in, of11_in.size, table_id ? atoi(table_id) : 0,
+ &ofpacts);
if (error) {
printf("bad OF1.1 instructions: %s\n\n", ofperr_get_name(error));
ofpbuf_uninit(&ofpacts);