]> git.proxmox.com Git - mirror_ovs.git/commit
odp-util: Make checks for exact or wildcard masks more precise.
authorBen Pfaff <blp@ovn.org>
Mon, 31 Jul 2017 19:36:48 +0000 (12:36 -0700)
committerBen Pfaff <blp@ovn.org>
Mon, 31 Jul 2017 23:20:28 +0000 (16:20 -0700)
commitb17298ae49c00dda7808de14efc1b8f488ba40b1
treea66c0364ac3e8db568af2e397556a319aaa6df57
parentdf1a62cbd08e1e37335dc8736ab4d5f24d8a3d4e
odp-util: Make checks for exact or wildcard masks more precise.

Checking whether an ODP mask is all-0s or all-1s is a little more
complicated than one might expect because the structures sometimes have
trailing padding.  The function odp_mask_is_exact() was fairly careful
about this, but odp_mask_attr_is_wildcard() didn't take padding into
consideration at all, which caused test failures on Travis and on some
machines because of uninitialized padding.

This commit fixes the problem by unifying the two different functions so
that both of them are careful about checking only significant bytes.  It
also adds support for the ct_orig_tuples for IPv4 and IPv6, which also
have trailing padding but weren't special cased before.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
lib/odp-util.c