From ff3c2c63af78b71d77eb119bd6398783a28b6f4c Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 24 Oct 2013 12:07:44 +0900 Subject: [PATCH] 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 --- OPENFLOW-1.1+ | 1 + ofproto/ofproto.c | 7 +++++++ 2 files changed, 8 insertions(+) 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. */ -- 2.43.0