From e94b92baf63322117e22a7432e1740afa3073587 Mon Sep 17 00:00:00 2001
From: Ben Pfaff <blp@nicira.com>
Date: Tue, 16 Nov 2010 10:25:22 -0800
Subject: [PATCH] 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.
---
 utilities/ovs-ofctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index 1901e242..e46e1a2d 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
-- 
2.30.2