From: Ben Pfaff Date: Tue, 12 Feb 2013 23:49:12 +0000 (-0800) Subject: ofp-msgs: ensure that l2 is set in ofpmp_reserve() X-Git-Tag: sliver-openvswitch-1.10.90-1~11^2~44 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=c0bf00b922eeace65846cc1309a71adb69fe0eda;p=sliver-openvswitch.git ofp-msgs: ensure that l2 is set in ofpmp_reserve() Ensure that the buffer returned by ofpmp_reserve() has buf->l2 set as this may be required by nxm_reg_load_to_nxast() when generating the reply to an stats request This problem was observed when dumping a large number of flows with set_field actions using ovs-ofctl dump-flows. Signed-off-by: Ben Pfaff Co-authored-by: Simon Horman Signed-off-by: Simon Horman --- diff --git a/lib/ofp-msgs.c b/lib/ofp-msgs.c index efc4198af..af4178eb4 100644 --- a/lib/ofp-msgs.c +++ b/lib/ofp-msgs.c @@ -851,6 +851,8 @@ ofpmp_reserve(struct list *replies, size_t len) next = ofpbuf_new(MAX(1024, hdrs_len + len)); ofpbuf_put(next, msg->data, hdrs_len); + next->l2 = next->data; + next->l3 = ofpbuf_tail(next); list_push_back(replies, &next->list_node); *ofpmp_flags__(msg->data) |= htons(OFPSF_REPLY_MORE);