From: Ben Pfaff <blp@nicira.com>
Date: Fri, 9 Nov 2012 17:59:12 +0000 (-0800)
Subject: ofp-util: Make ofputil_encode_hello() return a message with correct length.
X-Git-Tag: sliver-openvswitch-1.9.90-3~10^2~203
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=1804d25a21dcdec83437ab1ebf9daf683d7e50da;p=sliver-openvswitch.git

ofp-util: Make ofputil_encode_hello() return a message with correct length.

This doesn't fix a visible bug, because code to send OpenFlow messages
updates the length itself, but it still seems like the right thing to do.

Signed-off-by: Ben Pfaff <blp@nicira.com>
---

diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 14ac7c13d..dea4aeafc 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -1188,6 +1188,8 @@ ofputil_encode_hello(uint32_t allowed_versions)
         oheh->type = htons(OFPHET_VERSIONBITMAP);
         oheh->length = htons(map_len + sizeof *oheh);
         *(ovs_be32 *)(oheh + 1) = htonl(allowed_versions);
+
+        ofpmsg_update_length(msg);
     }
 
     return msg;