X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=utilities%2Fovs-ofctl.c;h=fef7fdacc33d00a9318ab6b20ac4ae6cb24b579d;hb=84095d268f41efd2754fb920b9e93b665f7b64ba;hp=e948c662b06d2fdb704ad43a8c2a401749215f55;hpb=c4ea79bf9c68a4d040a499d142e121f01b314242;p=openvswitch diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index e948c662..fef7fdac 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -272,13 +272,14 @@ open_vconn(const char *name, struct vconn **vconnp) } static void * -alloc_stats_request(size_t body_len, uint16_t type, struct ofpbuf **bufferp) +alloc_stats_request(size_t rq_len, uint16_t type, struct ofpbuf **bufferp) { struct ofp_stats_msg *rq; - rq = make_openflow(sizeof *rq + body_len, OFPT_STATS_REQUEST, bufferp); + + rq = make_openflow(rq_len, OFPT_STATS_REQUEST, bufferp); rq->type = htons(type); rq->flags = htons(0); - return rq + 1; + return rq; } static void @@ -344,7 +345,7 @@ static void dump_trivial_stats_transaction(const char *vconn_name, uint8_t stats_type) { struct ofpbuf *request; - alloc_stats_request(0, stats_type, &request); + alloc_stats_request(sizeof(struct ofp_stats_msg), stats_type, &request); dump_stats_transaction(vconn_name, request); }