Skip to content

Commit

Permalink
ofp-actions: Allow meter actions in ofpacts_verify().
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Jarno Rajahalme <[email protected]>
  • Loading branch information
blp committed Nov 5, 2013
1 parent e34afc3 commit b2a27dd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/ofp-actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -2150,14 +2150,15 @@ ofpacts_verify(const struct ofpact ofpacts[], size_t ofpacts_len)
const struct ofpact *a;
enum ovs_instruction_type inst;

inst = OVSINST_OFPIT11_APPLY_ACTIONS;
inst = OVSINST_OFPIT13_METER;
OFPACT_FOR_EACH (a, ofpacts, ofpacts_len) {
enum ovs_instruction_type next;

next = ovs_instruction_type_from_ofpact_type(a->type);
if (inst == OVSINST_OFPIT11_APPLY_ACTIONS
? next < inst
: next <= inst) {
if (a > ofpacts
&& (inst == OVSINST_OFPIT11_APPLY_ACTIONS
? next < inst
: next <= inst)) {
const char *name = ovs_instruction_name_from_type(inst);
const char *next_name = ovs_instruction_name_from_type(next);

Expand Down
12 changes: 12 additions & 0 deletions tests/ofp-print.at
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,18 @@ OFPT_FLOW_MOD (OF1.2) (xid=0x52334507): ADD priority=255,sctp actions=set_field:
])
AT_CLEANUP

dnl This triggered a buggy "instructions out of order" message earlier.
AT_SETUP([OFPT_FLOW_MOD - OF1.3 - meter])
AT_KEYWORDS([ofp-print])
AT_CHECK([ovs-ofctl ofp-print "\
04 0e 00 40 cf fe 6b 86 00 00 00 00 00 00 00 00 \
00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 e8 \
ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \
00 01 00 04 00 00 00 00 00 06 00 08 00 00 00 01"], [0], [dnl
OFPT_FLOW_MOD (OF1.3) (xid=0xcffe6b86): ADD priority=1000 actions=meter:1
])
AT_CLEANUP

AT_SETUP([OFPT_FLOW reply - OF1.2 - set-field ip_src])
AT_KEYWORDS([ofp-print])
AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\
Expand Down

0 comments on commit b2a27dd

Please sign in to comment.