odp-util: Support zero mask on ipv4 frag
Don't print frag parsing error if mask is zero,
instead just don't print it.
@@ -2864,22 +2864,19 @@ 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;
-
- /* 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. */
+ /* ODP frag is an enumeration field; partial masks are not meaningful. */
+ if (!mask_empty && !mask_full) {
ds_put_format(ds, "error: partial mask not supported for frag (%#"
PRIx8"),", *mask);
- } else {
+ } else if (!mask_empty) {
ds_put_format(ds, "%s=%s,", name, ovs_frag_type_to_string(key));
}
}
-}
static bool
mask_empty(const struct nlattr *ma)
