From: YAMAMOTO Takashi Date: Thu, 24 Oct 2013 03:07:44 +0000 (+0900) Subject: ofproto: Report multipart buffer overflow. X-Git-Tag: sliver-openvswitch-2.0.90-1~7^2~4 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=ff3c2c63af78b71d77eb119bd6398783a28b6f4c;hp=76ec08e01b4075b2e6d76ecbc5872513dd5b873f;p=sliver-openvswitch.git ofproto: Report multipart buffer overflow. Because our size of the multipart request buffer is effectively 0, always report multipart buffer overflow error for multipart requests with "more" flag set. While this might be simpler if done in ofp-msgs.c, i put this in ofproto.c because it seems like a better place to implement the buffering logic if/when desirable. An option question: what to do for the following messages with the same xid? especially for the last message which doesn't have the "more" flag set? it would be neater to detect and drop them. Signed-off-by: YAMAMOTO Takashi Signed-off-by: Ben Pfaff --- diff --git a/OPENFLOW-1.1+ b/OPENFLOW-1.1+ index 47cb60323..f41980381 100644 --- a/OPENFLOW-1.1+ +++ b/OPENFLOW-1.1+ @@ -117,6 +117,7 @@ end of the OF1.3 spec, reusing most of the section titles directly. I didn't compare the specs carefully yet.) * Add support for multipart requests. + Currently we always report OFPBRC_MULTIPART_BUFFER_OVERFLOW. [optional for OF1.3+] * Add OFPMP_TABLE_FEATURES statistics. diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index cb5bc735d..8fa5e8473 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -5677,6 +5677,13 @@ handle_openflow__(struct ofconn *ofconn, const struct ofpbuf *msg) if (error) { return error; } + if (oh->version >= OFP13_VERSION && ofpmsg_is_stat_request(oh) + && ofpmp_more(oh)) { + /* We have no buffer implementation for multipart requests. + * Report overflow for requests which consists of multiple + * messages. */ + return OFPERR_OFPBRC_MULTIPART_BUFFER_OVERFLOW; + } switch (type) { /* OpenFlow requests. */