On Thu, Jun 14, 2012 at 08:51:53AM +0900, Simon Horman wrote:
> Pass a protocol based on the prevailing protocol to ofputil_decode_flow_mod()
> 
> Note that ofputil_protocol_from_ofp_version() needs to be made
> Open Flow 1.1 aware.
> 
> Signed-off-by: Simon Horman <[email protected]>
> ---
>  lib/ofp-print.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/lib/ofp-print.c b/lib/ofp-print.c
> index 87b2978..2c0d189 100644
> --- a/lib/ofp-print.c
> +++ b/lib/ofp-print.c
> @@ -664,6 +664,16 @@ ofp_print_flow_mod(struct ds *s, const struct ofp_header 
> *oh)
>      struct ofputil_flow_mod fm;
>      struct ofpbuf ofpacts;
>      enum ofperr error;
> +    enum ofputil_protocol protocol;
> +
> +    switch(oh->version) {
> +    case OFP10_VERSION:
> +          protocol = OFPUTIL_P_OF10_TID;
> +          break;
> +    default:
> +          protocol = ofputil_protocol_from_ofp_version(oh->version);
> +          break;
> +    }
>  
>      ofpbuf_init(&ofpacts, 64);
>      error = ofputil_decode_flow_mod(&fm, oh, OFPUTIL_P_OF10_TID, &ofpacts);

The line above should be updated to:

        error = ofputil_decode_flow_mod(&fm, oh, protocol, &ofpacts);
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to