[ovs-dev] [PATCH 1/2] ofproto: report correct errors for unsupported stats/multipart requests

Ben Pfaff blp at nicira.com
Fri Oct 25 03:55:13 UTC 2013


On Thu, Oct 24, 2013 at 12:07:43PM +0900, YAMAMOTO Takashi wrote:
> the correct error in that case is OFPERR_OFPBRC_BAD_STAT,
> not OFPERR_OFPBRC_BAD_TYPE.
> 
> currently, the only example of unsupported stats/multipart request is
> OFPTYPE_TABLE_FEATURES_STATS_REQUEST.
> 
> Signed-off-by: YAMAMOTO Takashi <yamamoto at valinux.co.jp>

Thanks a lot.

I applied this, folding in the following stylistic changes:

diff --git a/lib/ofp-msgs.c b/lib/ofp-msgs.c
index b58e53b..9f1b453 100644
--- a/lib/ofp-msgs.c
+++ b/lib/ofp-msgs.c
@@ -262,7 +262,6 @@ ofphdrs_decode_assert(struct ofphdrs *hdrs,
 static bool
 ofp_is_stat_request(enum ofp_version version, uint8_t type)
 {
-
     switch (version) {
     case OFP10_VERSION:
         return type == OFPT10_STATS_REQUEST;
@@ -278,7 +277,6 @@ ofp_is_stat_request(enum ofp_version version, uint8_t type)
 static bool
 ofp_is_stat_reply(enum ofp_version version, uint8_t type)
 {
-
     switch (version) {
     case OFP10_VERSION:
         return type == OFPT10_STATS_REPLY;
@@ -294,16 +292,14 @@ ofp_is_stat_reply(enum ofp_version version, uint8_t type)
 static bool
 ofp_is_stat(enum ofp_version version, uint8_t type)
 {
-
-    return ofp_is_stat_request(version, type)
-        || ofp_is_stat_reply(version, type);
+    return (ofp_is_stat_request(version, type) ||
+            ofp_is_stat_reply(version, type));
 }
 
 static bool
 ofphdrs_is_stat(const struct ofphdrs *hdrs)
 {
-
-    return ofp_is_stat((enum ofp_version) hdrs->version, hdrs->type);
+    return ofp_is_stat(hdrs->version, hdrs->type);
 }
 
 size_t
@@ -846,7 +842,6 @@ ofpmsg_body(const struct ofp_header *oh)
 bool
 ofpmsg_is_stat_request(const struct ofp_header *oh)
 {
-
     return ofp_is_stat_request(oh->version, oh->type);
 }
 



More information about the dev mailing list