From: Ben Pfaff Date: Tue, 16 Nov 2010 18:25:22 +0000 (-0800) Subject: ovs-ofctl: Fix return value of str_to_port_no(). X-Git-Tag: v1.1.0~838 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=e94b92baf63322117e22a7432e1740afa3073587;p=sliver-openvswitch.git ovs-ofctl: Fix return value of str_to_port_no(). 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. --- diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index 1901e242a..e46e1a2db 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