2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

odp-util: Support zero mask on ipv4 frag

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>
This commit is contained in:
Paul Blakey
2017-08-03 16:27:07 +03:00
committed by Ben Pfaff
parent eee693934a
commit 08fa0266b6

View 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));
}
}