From: Ben Pfaff Date: Fri, 21 Jan 2011 22:49:01 +0000 (-0800) Subject: ofproto: Correctly compute length of flow stats in multipart flow stats. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1dfee98d87605bc52ed58738edf01e201b189615;p=openvswitch ofproto: Correctly compute length of flow stats in multipart flow stats. In a flow table dump, the length of the first nx_flow_stats in the second and subsequent OpenFlow messages was being miscalculated, because append_nxstats_reply() changed the length of the message in such cases. So we need to load the starting length after calling append_nxstats_reply() instead of before. Reported-by: Reid Price Bug #4444. --- diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index e081e32e..7df8600e 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -3549,8 +3549,8 @@ put_nx_flow_stats(struct ofconn *ofconn, struct rule *rule, act_len = sizeof *rule->actions * rule->n_actions; - start_len = (*replyp)->size; append_nxstats_reply(sizeof *nfs + NXM_MAX_LEN + act_len, ofconn, replyp); + start_len = (*replyp)->size; reply = *replyp; nfs = ofpbuf_put_uninit(reply, sizeof *nfs);