[ovs-dev] [ofproto tests 01/29] ovs-ofctl: Fix return value of str_to_port_no().

Justin Pettit jpettit at nicira.com
Wed Nov 17 22:45:49 UTC 2010


Looks good.

--Justin


On Nov 16, 2010, at 11:20 AM, Ben Pfaff wrote:

> The index into the array of ports returned in the OFPT_FEATURES_REPLY
> message is not necessarily the same as the port number, so this fixes a
> real bug.
> ---
> utilities/ovs-ofctl.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
> index 1901e24..e46e1a2 100644
> --- a/utilities/ovs-ofctl.c
> +++ b/utilities/ovs-ofctl.c
> @@ -431,7 +431,7 @@ str_to_port_no(const char *vconn_name, const char *str)
>     ofpbuf_delete(reply);
>     vconn_close(vconn);
> 
> -    return port_idx;
> +    return ntohs(osf->ports[port_idx].port_no);
> }
> 
> static void
> -- 
> 1.7.1
> 
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev_openvswitch.org





More information about the dev mailing list