[ovs-dev] [PATCH] ofproto/trace: Fix parsing error.

Alex Wang alexw at nicira.com
Thu Apr 30 16:31:22 UTC 2015


ofproto/trace fails to parse the 'frag' in the ipv4 field due to a
bug in odp-util.c.  This commit fixes the bug.

Reported-by: Jacob Cherkas <jcherkas at nicira.com>
Signed-off-by: Alex Wang <alexw at nicira.com>
---
 lib/odp-util.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/odp-util.c b/lib/odp-util.c
index b82edb7..2a71bb2 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -2425,7 +2425,11 @@ scan_frag(const char *s, uint8_t *key, uint8_t *mask)
 
         *key = frag_type;
         if (mask) {
-            *mask = UINT8_MAX;
+            if (ovs_scan(s + len, "/%"SCNi8"%n", mask, &n)) {
+                len += n;
+            } else {
+                *mask = UINT8_MAX;
+            }
         }
         return len;
     }
-- 
1.7.9.5




More information about the dev mailing list