Signed-off-by: Simon Horman <ho...@verge.net.au> ---
v10 * No change v9 * Initial post --- utilities/ovs-ofctl.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index 606a3f2..81df40c 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -1434,7 +1434,6 @@ ofctl_snoop(int argc OVS_UNUSED, char *argv[]) static void ofctl_dump_ports(int argc, char *argv[]) { - struct ofp10_port_stats_request *req; struct ofpbuf *request; struct vconn *vconn; uint16_t port; @@ -1453,9 +1452,24 @@ ofctl_dump_ports(int argc, char *argv[]) NOT_REACHED(); } request = ofpraw_alloc(raw, vconn_get_version(vconn), 0); - req = ofpbuf_put_zeros(request, sizeof *req); port = argc > 2 ? str_to_port_no(vconn, argv[2]) : OFPP_NONE; - req->port_no = htons(port); + switch (vconn_get_version(vconn)) { + case OFP10_VERSION: { + struct ofp10_port_stats_request *req; + req = ofpbuf_put_zeros(request, sizeof *req); + req->port_no = htons(port); + break; + } + case OFP11_VERSION: + case OFP12_VERSION: { + struct ofp11_port_stats_request *req; + req = ofpbuf_put_zeros(request, sizeof *req); + req->port_no = ofputil_port_to_ofp11(port); + break; + } + default: + NOT_REACHED(); + } dump_stats_transaction(vconn, request); vconn_close(vconn); } -- 1.7.10.2.484.gcd07cc5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev