]> git.proxmox.com Git - mirror_ovs.git/commitdiff
odp-util: Support zero mask on ipv4 frag
authorPaul Blakey <paulb@mellanox.com>
Thu, 3 Aug 2017 13:27:07 +0000 (16:27 +0300)
committerBen Pfaff <blp@ovn.org>
Thu, 3 Aug 2017 19:51:55 +0000 (12:51 -0700)
Don't print frag parsing error if mask is zero,
instead just don't print it.

Signed-off-by: Paul Blakey <paulb@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/odp-util.c

index babed7537515319f15ade3f52ce245f8ae7e0e12..728e325ce57e3f6bd244101f5ebe85660e0b053a 100644 (file)
@@ -2864,20 +2864,17 @@ odp_ct_state_to_string(uint32_t flag)
 
 static void
 format_frag(struct ds *ds, const char *name, uint8_t key,
-            const uint8_t *mask, bool verbose)
+            const uint8_t *mask, bool verbose OVS_UNUSED)
 {
     bool mask_empty = mask && !*mask;
+    bool mask_full = !mask || *mask == UINT8_MAX;
 
     /* ODP frag is an enumeration field; partial masks are not meaningful. */
-    if (verbose || !mask_empty) {
-        bool mask_full = !mask || *mask == UINT8_MAX;
-
-        if (!mask_full) { /* Partially masked. */
-            ds_put_format(ds, "error: partial mask not supported for frag (%#"
-                          PRIx8"),", *mask);
-        } else {
-            ds_put_format(ds, "%s=%s,", name, ovs_frag_type_to_string(key));
-        }
+    if (!mask_empty && !mask_full) {
+        ds_put_format(ds, "error: partial mask not supported for frag (%#"
+                      PRIx8"),", *mask);
+    } else if (!mask_empty) {
+        ds_put_format(ds, "%s=%s,", name, ovs_frag_type_to_string(key));
     }
 }