As the structures uses for encoding and decoding statistics request and
reply messages are largely the same between OpenFlow 1.1 and 1.2 it seems
to make sense to use OFPT11_STATS_{REQUEST,REPLY} for OpenFlow 1.2.

This patch prepares the decode path.

Signed-off-by: Simon Horman <ho...@verge.net.au>

---

v7
* Manual Rebase

v6
* No change

v5
* No change

v4
* Initial post
---
 lib/ofp-msgs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/ofp-msgs.c b/lib/ofp-msgs.c
index 0a573dc..6cee734 100644
--- a/lib/ofp-msgs.c
+++ b/lib/ofp-msgs.c
@@ -207,7 +207,8 @@ ofphdrs_decode(struct ofphdrs *hdrs,
                 return OFPERR_OFPBRC_BAD_VENDOR;
             }
         }
-    } else if (hdrs->version == OFP11_VERSION
+    } else if ((hdrs->version == OFP11_VERSION ||
+                hdrs->version == OFP12_VERSION)
                && (hdrs->type == OFPT11_STATS_REQUEST ||
                    hdrs->type == OFPT11_STATS_REPLY)) {
         const struct ofp11_stats_msg *osm;
-- 
1.7.10.2.484.gcd07cc5

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to