Signed-off-by: Simon Horman <ho...@verge.net.au>

---

v5
* Initial Post
---
 lib/ofp-print.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/lib/ofp-print.c b/lib/ofp-print.c
index 8473a03..e80c597 100644
--- a/lib/ofp-print.c
+++ b/lib/ofp-print.c
@@ -1074,8 +1074,23 @@ static void print_port_stat(struct ds *string, const 
char *leader,
 static void
 ofp_print_ofpst_port_request(struct ds *string, const struct ofp_header *oh)
 {
-    const struct ofp10_port_stats_request *psr = ofputil_stats_msg_body(oh);
-    ds_put_format(string, " port_no=%"PRIu16, ntohs(psr->port_no));
+    switch (oh->version) {
+    case OFP12_VERSION:
+    case OFP11_VERSION: {
+        const struct ofp11_port_stats_request *psr = 
ofputil_stats_msg_body(oh);
+        ds_put_format(string, " port_no=%"PRIu32, ntohl(psr->port_no));
+        break;
+    }
+
+    case OFP10_VERSION: {
+        const struct ofp10_port_stats_request *psr = 
ofputil_stats_msg_body(oh);
+        ds_put_format(string, " port_no=%"PRIu16, ntohs(psr->port_no));
+        break;
+    }
+
+    default:
+        NOT_REACHED();
+    }
 }
 
 static void
-- 
1.7.10.2.484.gcd07cc5

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to