[ovs-dev] [PATCH 2/2] ofproto: report multipart buffer overflow

YAMAMOTO Takashi yamamoto at valinux.co.jp
Thu Oct 24 03:07:44 UTC 2013


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 <yamamoto at valinux.co.jp>
---
 OPENFLOW-1.1+     | 1 +
 ofproto/ofproto.c | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/OPENFLOW-1.1+ b/OPENFLOW-1.1+
index 47cb603..f419803 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 cb5bc73..8fa5e84 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. */
-- 
1.8.3.1




More information about the dev mailing list