I have no idea how I was earlier able to to test anything and not notice this.

The fix seems right. However, upon re-reading the spec (1.3.3), it seems the 
instructions
in the instruction set should be accepted in any order and executed in the order
specified. Thoughts?

  Jarno

Acked-by: Jarno Rajahalme <jrajaha...@nicira.com>

On Nov 4, 2013, at 10:42 PM, Ben Pfaff <b...@nicira.com> wrote:

> Signed-off-by: Ben Pfaff <b...@nicira.com>
> ---
> lib/ofp-actions.c  |    9 +++++----
> tests/ofp-print.at |   12 ++++++++++++
> 2 files changed, 17 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
> index bae479e..6c90d5c 100644
> --- a/lib/ofp-actions.c
> +++ b/lib/ofp-actions.c
> @@ -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);
> 
> diff --git a/tests/ofp-print.at b/tests/ofp-print.at
> index 8701f54..1cf9880 100644
> --- a/tests/ofp-print.at
> +++ b/tests/ofp-print.at
> @@ -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 "\
> -- 
> 1.7.10.4
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to