[ovs-dev] [learn bugs 3/5] learn: Allow read-only fields to be matched.

Ethan Jackson ethan at nicira.com
Tue Oct 18 19:49:14 UTC 2011


Looks good.

Ethan

On Tue, Sep 27, 2011 at 13:36, Ben Pfaff <blp at nicira.com> wrote:
> nxm_dst_check() requires a writable field.  Since NX_LEARN_DST_MATCH only
> matches on a field and doesn't write to a field, use nxm_src_check() for
> that case instead.
>
> Bug #7510.
> Reported-by: Michael Mao <mmao at nicira.com>
> ---
>  lib/learn.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/lib/learn.c b/lib/learn.c
> index 8927ff8..8d7e0b0 100644
> --- a/lib/learn.c
> +++ b/lib/learn.c
> @@ -160,7 +160,9 @@ learn_check(const struct nx_action_learn *learn, const struct flow *flow)
>             int dst_ofs = ntohs(get_be16(&p));
>             int error;
>
> -            error = nxm_dst_check(dst_field, dst_ofs, n_bits, &rule.flow);
> +            error = (dst_type == NX_LEARN_DST_LOAD
> +                     ? nxm_dst_check(dst_field, dst_ofs, n_bits, &rule.flow)
> +                     : nxm_src_check(dst_field, dst_ofs, n_bits, &rule.flow));
>             if (error) {
>                 return error;
>             }
> --
> 1.7.4.4
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>



More information about the dev mailing list