This is just a hack to change the way that ofputil_pull_ofp11_match() works
to what I believe to be a more correct version before adding feature
changes to the same function.

This change should either be dropped or rolled into Ben Pfaff's patch
that adds ofputil_pull_ofp11_match().

---

v2
* No change
---
 lib/ofp-util.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 307ad2c..5adb3a6 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -267,14 +267,13 @@ enum ofperr
 ofputil_pull_ofp11_match(struct ofpbuf *buf, unsigned int priority,
                          struct cls_rule *rule)
 {
-    struct ofp11_match_header *omh;
+    struct ofp11_match_header *omh = ofpbuf_pull(buf, sizeof *omh);
     struct ofp11_match *om;
 
-    if (buf->size < sizeof(struct ofp11_match_header)) {
+    if (buf->size < sizeof *omh) {
         return OFPERR_OFPBMC_BAD_LEN;
     }
 
-    omh = buf->data;
     switch (ntohs(omh->type)) {
     case OFPMT_STANDARD:
         if (omh->length != htons(sizeof *om) || buf->size < sizeof *om) {
-- 
1.7.10.2.484.gcd07cc5

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to