This member does not actually help with anything.
---
 include/openflow/openflow.h |    1 -
 lib/ofp-util.c              |    2 +-
 utilities/ovs-ofctl.c       |    5 ++---
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/include/openflow/openflow.h b/include/openflow/openflow.h
index 9213be6..5329f20 100644
--- a/include/openflow/openflow.h
+++ b/include/openflow/openflow.h
@@ -738,7 +738,6 @@ struct ofp_stats_msg {
     ovs_be16 type;              /* One of the OFPST_* constants. */
     ovs_be16 flags;             /* Requests: always 0.
                                  * Replies: 0 or OFPSF_REPLY_MORE. */
-    uint8_t body[0];            /* Body of the request. */
 };
 OFP_ASSERT(sizeof(struct ofp_stats_msg) == 12);
 
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 16b462b..c5987ed 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -434,7 +434,7 @@ check_nxstats_msg(const struct ofp_header *oh)
     const struct ofp_stats_msg *osm = (const struct ofp_stats_msg *) oh;
     ovs_be32 vendor;
 
-    memcpy(&vendor, osm->body, sizeof vendor);
+    memcpy(&vendor, osm + 1, sizeof vendor);
     if (vendor != htonl(NX_VENDOR_ID)) {
         VLOG_WARN_RL(&bad_ofmsg_rl, "received vendor stats message for "
                      "unknown vendor %"PRIx32, ntohl(vendor));
diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index 52e89d0..f8d456a 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -263,11 +263,10 @@ static void *
 alloc_stats_request(size_t body_len, uint16_t type, struct ofpbuf **bufferp)
 {
     struct ofp_stats_msg *rq;
-    rq = make_openflow((offsetof(struct ofp_stats_msg, body)
-                        + body_len), OFPT_STATS_REQUEST, bufferp);
+    rq = make_openflow(sizeof *rq + body_len, OFPT_STATS_REQUEST, bufferp);
     rq->type = htons(type);
     rq->flags = htons(0);
-    return rq->body;
+    return rq + 1;
 }
 
 static void
-- 
1.7.4.4

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to